Commit 85d5121a authored by Matthias Leich's avatar Matthias Leich

Merge of fixes for Bug#36874,#38427,#37744,#38762

with actual tree
......@@ -9,7 +9,9 @@ DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
SET @OLD_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @OLD_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= 0;
SET @OLD_SLAVE_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= 0;
DROP TABLE IF EXISTS federated.bug_13118_table;
CREATE TABLE federated.t1 (
......@@ -51,9 +53,10 @@ id value
7 54
8 55
DROP TABLE federated.t1;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
DROP TABLE federated.t1;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_CONCURRENT_INSERT;
SET @global_slow_launch_time = @@GLOBAL.slow_launch_time;
'#--------------------FN_DYNVARS_124_01-------------------------#'
** Connection default **
'#--------------------FN_DYNVARS_124_01-------------------------#'
SET @@GLOBAL.slow_launch_time=0;
SELECT @@GLOBAL.slow_launch_time;
@@GLOBAL.slow_launch_time
0
** Connecting conn5 using username 'root' **
** Connecting conn6 using username 'root' **
** Connecting conn7 using username 'root' **
** Connecting conn8 using username 'root' **
** Connecting conn9 using username 'root' **
** Connecting conn10 using username 'root' **
** Connecting conn11 using username 'root' **
** Connecting conn12 using username 'root' **
** Connecting conn13 using username 'root' **
** Connecting conn14 using username 'root' **
** Connecting conn15 using username 'root' **
** Connecting conn16 using username 'root' **
show status like 'slow_launch_threads';
Variable_name Value
Slow_launch_threads 12
12 Expected
** Connection default **
** Disconnecting conn5 **
** Disconnecting conn6 **
** Disconnecting conn7 **
** Disconnecting conn8 **
** Disconnecting conn9 **
** Disconnecting conn10 **
** Disconnecting conn11 **
** Disconnecting conn12 **
** Disconnecting conn13 **
** Disconnecting conn14 **
** Disconnecting conn15 **
** Disconnecting conn16 **
** Connecting conn1 using username 'root' **
** Switch to connection default and disconnect conn1 **
'#--------------------FN_DYNVARS_124_02-------------------------#'
SET @@GLOBAL.slow_launch_time= 1000;
SELECT @@GLOBAL.slow_launch_time;
@@GLOBAL.slow_launch_time
1000
** Connecting conn2 using username 'root' **
** Switch to connection default and disconnect conn2 **
SET @@GLOBAL.slow_launch_time = @global_slow_launch_time;
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
# suite/funcs_1/storedproc/param_check.inc
#
# Auxiliary routine to be sourced by
# suite/funcs_1/t/storedproc.test
#
# Purpose:
# The assignment of float values to objects of type DECIMAL causes
# conversions and in some cases an adjustment of the value to
# a border of the value range.
# Try to reveal that function and procedure parameters get a similar
# mangling of the value like columns.
#
# Variables to be set before sourcing this routine
# $test_value - value to be checked
#
# Created:
# 2008-08-27 mleich
#
eval UPDATE t1_aux SET f1 = NULL;
# Enforce that all user variables have the same data type and initial value.
SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux;
eval UPDATE t1_aux SET f1 = $test_value;
SELECT f1 INTO @v1_tab FROM t1_aux;
eval CALL sproc_1($test_value, @v1_proc);
eval SET @v1_func = func_1($test_value);
if (`SELECT @v1_tab <> @v1_proc OR @v1_tab <> @v2_proc OR @v1_tab <> @v1_func`)
{
--echo Error: @v1_tab, @v1_proc, @v2_proc, @v1_func are not all equal
SELECT @v1_tab, @v1_proc, @v2_proc, @v1_func;
}
#### suite/funcs_1/t/innodb_storedproc.test
#
# This test cannot be used for the embedded server because we check here
# privileges.
--source include/not_embedded.inc
--source include/have_innodb.inc
let $engine_type= innodb;
--source suite/funcs_1/storedproc/load_sp_tb.inc
--source suite/funcs_1/storedproc/storedproc_master.inc
#### suite/funcs_1/t/memory_storedproc.test
#
# This test cannot be used for the embedded server because we check here
# privileges.
--source include/not_embedded.inc
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
let $engine_type= memory;
--source suite/funcs_1/storedproc/load_sp_tb.inc
--source suite/funcs_1/storedproc/storedproc_master.inc
#### suite/funcs_1/t/myisam_storedproc.test
#
# This test cannot be used for the embedded server because we check here
# privileges.
--source include/not_embedded.inc
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
let $engine_type= myisam;
--source suite/funcs_1/storedproc/load_sp_tb.inc
--source suite/funcs_1/storedproc/storedproc_master.inc
#### suite/funcs_1/t/ndb_storedproc.test
#
# This test cannot be used for the embedded server because we check here
# privileges.
--source include/not_embedded.inc
--source include/have_ndb.inc
let $engine_type= ndb;
--source suite/funcs_1/storedproc/load_sp_tb.inc
--source suite/funcs_1/storedproc/storedproc_master.inc
#### suite/funcs_1/storedproc/storedproc_master.inc
###########################################################################
# WL4084: Review and fix all disabled test
# enabled this test.
# 2007-Oct-04 Hhunger
# suite/funcs_1/t/storedproc.test
#
# Check general properties of stored procedures.
#
# Last Modification:
# 2008-08-27 mleich - Fix Bug#37744 Expected result of "<engine>_storedproc"
# test is inconsistent
# - remove variation of storage engines
# - restore global sort_buffer_size after some subtest
#
############################################################################
--enable_query_log
# This test cannot be used for the embedded server because we check here
# privileges.
--source include/not_embedded.inc
# It is assumed that the storage engine used for some tables has no impact on
# the outcome of this test. Therefor we use simply the fastest engine.
let $engine_type= memory;
--source suite/funcs_1/storedproc/load_sp_tb.inc
# ==============================================================================
let $message= Section 3.1.1 - Syntax checks for the CREATE PROCEDURE, CREATE
echo;
echo
Section 3.1.1 - Syntax checks for the CREATE PROCEDURE, CREATE
FUNCTION, ALTER PROCEDURE, ALTER FUNCTION, DROP PROCEDURE, DROP FUNCTION, SHOW
CREATE PROCEDURE, SHOW CREATE FUNCTION, SHOW CREATE PROCEDURE STATUS, SHOW
CREATE FUNCTION STATUS, and CALL statements:;
--source include/show_msg80.inc
echo --------------------------------------------------------------------------------;
# ------------------------------------------------------------------------------
let $message= Testcase 4.1.1:
---------------
Ensure that all clauses that should be supported are supported
CREATE PROCEDURE;
--source include/show_msg80.inc
echo;
echo
Testcase 4.1.1:
---------------
Ensure that all clauses that should be supported are supported
CREATE PROCEDURE;
echo --------------------------------------------------------------------------------;
USE db_storedproc;
......@@ -41,9 +60,10 @@ DROP PROCEDURE IF EXISTS sp1_thisisaveryverylongname234872934_thisisaveryverylon
delimiter //;
--error ER_TOO_LONG_IDENT
CREATE PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde( f1 tinytext ) language sql deterministic sql security definer comment 'this is simple'
BEGIN
set @v1 = f1;
CREATE PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde( f1 TINYTEXT )
LANGUAGE SQL DETERMINISTIC SQL SECURITY DEFINER COMMENT 'this is simple'
BEGIN
SET @v1 = f1;
SELECT @v1, @v1;
END//
delimiter ;//
......@@ -51,33 +71,35 @@ delimiter ;//
--error ER_TOO_LONG_IDENT
CALL sp1_thisisaveryverylongname234872934_thisisaveryverylongnameabcde( 'abc' );
--replace_column 5 modified 6 created
SHOW PROCEDURE status;
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE STATUS;
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
CREATE PROCEDURE sp1( f1 binary ) language sql not deterministic sql security invoker comment 'this is simple'
BEGIN
set @v1 = f1;
CREATE PROCEDURE sp1( f1 BINARY )
LANGUAGE SQL DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
SET @v1 = f1;
SELECT @v1;
END//
delimiter ;//
CALL sp1( 34 );
--replace_column 5 modified 6 created
SHOW PROCEDURE status;
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE STATUS;
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
CREATE PROCEDURE sp1( f1 blob ) language sql not deterministic sql security invoker comment 'this is simple'
BEGIN
CREATE PROCEDURE sp1( f1 BLOB )
LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
set @v1 = f1;
SELECT @v1;
END//
......@@ -85,25 +107,26 @@ delimiter ;//
CALL sp1( 34 );
--replace_column 5 modified 6 created
SHOW PROCEDURE status;
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE STATUS;
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
CREATE PROCEDURE sp1( f1 int ) language sql not deterministic sql security invoker comment 'this is simple'
CREATE PROCEDURE sp1( f1 INT )
LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
set @v1 = f1;
SET @v1 = f1;
SELECT @v1;
END//
delimiter ;//
CALL sp1( 34 );
--replace_column 5 modified 6 created
SHOW PROCEDURE status;
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE STATUS;
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
......@@ -111,108 +134,163 @@ DROP PROCEDURE IF EXISTS sp1;
delimiter //;
--error ER_TOO_BIG_PRECISION
CREATE PROCEDURE sp1( f1 decimal(256, 30) ) language sql not deterministic sql security invoker comment 'this is simple'
CREATE PROCEDURE sp1( f1 DECIMAL(256, 30) )
LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
set @v1 = f1;
SET @v1 = f1;
SELECT @v1;
END//
DROP PROCEDURE IF EXISTS sp1//
--error ER_TOO_BIG_PRECISION
CREATE PROCEDURE sp1( f1 decimal(66, 30) ) language sql not deterministic sql security invoker comment 'this is simple'
CREATE PROCEDURE sp1( f1 DECIMAL(66, 30) )
LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
set @v1 = f1;
SET @v1 = f1;
SELECT @v1;
END//
DROP PROCEDURE IF EXISTS sp1//
delimiter ;//
CREATE PROCEDURE sp1( f1 decimal(60, 30) ) language sql not deterministic sql security invoker comment 'this is simple'
# Check assignment of float values to DECIMAL(65, 30) parameters of
# PRODDUREs and FUNCTIONs.
###########################################################################
# - The assignment of float values causes that conversions with OS/compiler
# specific math libraries are involved.
# --> The content depends on the testing box and simple printing
# of content will often lead to differences.
# - We have the same conversions when assigning float values to columns
# of tables.
# --> Reveal that we have a consistent behaviour per testing box.
#
# Checks that floating point values assigned to objects of type DECIMAL
# end up with correct DECIMAL values (truncated to a border of the DECIMAL
# value range or reasonable nearby the floating point value) must be done
# in other tests.
###########################################################################
--disable_warnings
DROP TABLE IF EXISTS t1_aux;
DROP PROCEDURE IF EXISTS sproc_1;
DROP FUNCTION IF EXISTS func_1;
--enable_warnings
CREATE TABLE t1_aux ( f1 DECIMAL(65, 30) );
INSERT INTO t1_aux SET f1 = NULL;
delimiter //;
CREATE PROCEDURE sproc_1(f1 DECIMAL(65, 30), OUT f2 DECIMAL(65, 30))
LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
set @v1 = f1;
SELECT @v1;
SET f2 = NULL;
SET f2 = f1;
SET @v2_proc = f1;
END//
CREATE FUNCTION func_1(f1 DECIMAL(65, 30)) RETURNS DECIMAL(65,30)
LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
RETURN f1;
END//
delimiter ;//
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE STATUS;
--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS;
CALL sp1( 17976931340000 );
# switched off due to big differences with (e.g....) sol10-sparc-b
CALL sp1( 1.797693134e+13 );
--error ER_ILLEGAL_VALUE_FOR_TYPE
CALL sp1( 1.7976931348623157493578e+308 );
# check all ...E+100 to E-100
let $digits= 100;
while ($digits)
let $test_value = 1.7976931348623157493578e+308;
--source suite/funcs_1/storedproc/param_check.inc
#
# Check all ...E+nnn
let digits= 100;
let $run= 1;
while ($run)
{
eval CALL sp1( 0.1234567890987654321e+$digits );
eval CALL sp1( 0.1234567890987654321e-$digits );
let $test_value = 0.1234567890987654321e+$digits;
--source suite/funcs_1/storedproc/param_check.inc
let $run = `SELECT $digits > 0`;
if ($run)
{
dec $digits;
}
}
# Check all ...E-nnn
let digits= 100;
let $run= 1;
while ($run)
{
let $test_value = 0.1234567890987654321e-$digits;
--source suite/funcs_1/storedproc/param_check.inc
let $run = `SELECT $digits > 0`;
if ($run)
{
dec $digits;
}
}
# check the 2 values which cannot be handled easy in the loop:
eval CALL sp1( 0.1234567890987654321e+0 );
eval CALL sp1( 0.1234567890987654321e-0 );
--replace_column 5 modified 6 created
SHOW PROCEDURE status;
# Cleanup
DROP PROCEDURE sproc_1;
DROP FUNCTION func_1;
DROP TABLE t1_aux;
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
CREATE PROCEDURE sp1( f1 enum("value1", "value1") ) language sql not deterministic sql security invoker comment 'this is simple'
BEGIN
CREATE PROCEDURE sp1( f1 ENUM("value1", "value1") )
LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
SELECT f1;
END//
delimiter ;//
CALL sp1( "value1" );
--replace_column 5 modified 6 created
SHOW PROCEDURE status;
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE STATUS;
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
CREATE PROCEDURE sp1( f1 set("value1", "value1") ) language sql not deterministic sql security invoker comment 'this is simple'
BEGIN
CREATE PROCEDURE sp1( f1 SET("value1", "value1") )
LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
SELECT f1;
END//
delimiter ;//
CALL sp1( "value1, value1" );
--replace_column 5 modified 6 created
SHOW PROCEDURE status;
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE STATUS;
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
CREATE PROCEDURE sp1( f1 enum("value1", "value1") ) language sql not deterministic sql security invoker comment 'this is simple'
BEGIN
CREATE PROCEDURE sp1( f1 ENUM("value1", "value1") )
LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
SELECT f1;
END//
delimiter ;//
CALL sp1( "value1" );
--replace_column 5 modified 6 created
SHOW PROCEDURE status;
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE STATUS;
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
CREATE PROCEDURE sp1( f1 text ) language sql SELECT f1;
CREATE PROCEDURE sp1( f1 TEXT ) LANGUAGE SQL SELECT f1;
CALL sp1( 'abc' );
--replace_column 5 modified 6 created
SHOW PROCEDURE status like 'sp1';
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE STATUS LIKE 'sp1';
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
......@@ -221,48 +299,48 @@ DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( f1 text ) deterministic SELECT f1;
CALL sp1( 'abc' );
--replace_column 5 modified 6 created
SHOW PROCEDURE status like 'sp1';
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE STATUS LIKE 'sp1';
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
CREATE PROCEDURE sp1( f1 text ) not deterministic SELECT f1;
CREATE PROCEDURE sp1( f1 TEXT ) NOT DETERMINISTIC SELECT f1;
CALL sp1( 'abc' );
--replace_column 5 modified 6 created
SHOW PROCEDURE status like 'sp1';
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE STATUS LIKE 'sp1';
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
CREATE PROCEDURE sp1( f1 text ) sql security definer SELECT f1;
CREATE PROCEDURE sp1( f1 TEXT ) SQL SECURITY DEFINER SELECT f1;
CALL sp1( 'abc' );
--replace_column 5 modified 6 created
SHOW PROCEDURE status like 'sp1';
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE STATUS LIKE 'sp1';
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
CREATE PROCEDURE sp1( f1 text ) sql security invoker SELECT f1;
CREATE PROCEDURE sp1( f1 TEXT ) SQL SECURITY INVOKER SELECT f1;
CALL sp1( 'abc' );
--replace_column 5 modified 6 created
SHOW PROCEDURE status like 'sp1';
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE STATUS LIKE 'sp1';
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
CREATE PROCEDURE sp1( f1 text ) comment 'this is simple' SELECT f1;
CREATE PROCEDURE sp1( f1 TEXT ) COMMENT 'this is simple' SELECT f1;
CALL sp1( 'abc' );
--replace_column 5 modified 6 created
SHOW PROCEDURE status like 'sp1';
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE STATUS LIKE 'sp1';
# cleanup
DROP PROCEDURE sp1_thisisaveryverylongname234872934_thisisaveryverylongname234872934;
......@@ -281,8 +359,8 @@ let $message= Testcase 4.1.2:
DROP FUNCTION IF EXISTS fn1;
--enable_warnings
CREATE FUNCTION fn1 (s char(20)) returns char(50)
return concat('hello, ', s, '!');
CREATE FUNCTION fn1 (s CHAR(20)) RETURNS CHAR(50)
RETURN CONCAT('hello, ', s, '!');
SELECT fn1('world');
--disable_warnings
......@@ -290,17 +368,18 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
CREATE FUNCTION fn1( f1 mediumtext ) returns mediumtext language sql deterministic sql security definer comment 'this is simple'
BEGIN
set @v1 = 'hello';
set f1 = concat( @v1, f1 );
return f1;
CREATE FUNCTION fn1( f1 MEDIUMTEXT ) RETURNS MEDIUMTEXT
LANGUAGE SQL DETERMINISTIC SQL SECURITY DEFINER COMMENT 'this is simple'
BEGIN
SET @v1 = 'hello';
SET f1 = CONCAT( @v1, f1 );
RETURN f1;
END//
delimiter ;//
SELECT fn1( ' world');
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
......@@ -308,16 +387,17 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
CREATE FUNCTION fn1( f1 smallint ) returns smallint language sql not deterministic sql security invoker comment 'this is simple'
CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT
LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
set f1 = 1 + f1;
return f1;
SET f1 = 1 + f1;
RETURN f1;
END//
delimiter ;//
SELECT fn1( 126 );
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
......@@ -327,10 +407,11 @@ DROP FUNCTION IF EXISTS fn1;
delimiter //;
# 1425: Too big scale 63 specified for column ''. Maximum is 30.
--error ER_TOO_BIG_SCALE
CREATE FUNCTION fn1( f1 decimal(63, 31) ) returns decimal(63, 31) language sql not deterministic sql security invoker comment 'this is simple'
CREATE FUNCTION fn1( f1 DECIMAL(63, 31) ) RETURNS DECIMAL(63, 31)
LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
set f1 = 1000000 + f1;
return f1;
SET f1 = 1000000 + f1;
RETURN f1;
END//
delimiter ;//
......@@ -338,16 +419,17 @@ delimiter ;//
SELECT fn1( 1.3326e+8 );
delimiter //;
CREATE FUNCTION fn1( f1 decimal(63, 30) ) returns decimal(63, 30) language sql not deterministic sql security invoker comment 'this is simple'
CREATE FUNCTION fn1( f1 DECIMAL(63, 30) ) RETURNS DECIMAL(63, 30)
LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
set f1 = 1000000 + f1;
return f1;
SET f1 = 1000000 + f1;
RETURN f1;
END//
delimiter ;//
SELECT fn1( 1.3326e+8 );
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
......@@ -355,9 +437,10 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
CREATE FUNCTION fn1( f1 enum("value1", "value1") ) returns decimal(63, 30) language sql not deterministic sql security invoker comment 'this is simple'
BEGIN
return f1;
CREATE FUNCTION fn1( f1 ENUM("value1", "value1") ) RETURNS DECIMAL(63, 30)
LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
RETURN f1;
END//
delimiter ;//
......@@ -370,7 +453,7 @@ delimiter ;//
SELECT fn1( "value1" );
--enable_warnings
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
......@@ -378,9 +461,10 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
CREATE FUNCTION fn1( f1 set("value1", "value1") ) returns decimal(63, 30) language sql not deterministic sql security invoker comment 'this is simple'
BEGIN
return f1;
CREATE FUNCTION fn1( f1 SET("value1", "value1") ) RETURNS DECIMAL(63, 30)
LANGUAGE SQL NOT DETERMINISTIC SQL SECURITY INVOKER COMMENT 'this is simple'
BEGIN
RETURN f1;
END//
delimiter ;//
......@@ -393,7 +477,7 @@ delimiter ;//
SELECT fn1( "value1, value1" );
--enable_warnings
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
......@@ -401,16 +485,16 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
CREATE FUNCTION fn1( f1 smallint ) returns smallint language sql
BEGIN
set f1 = 1 + f1;
return f1;
CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT LANGUAGE SQL
BEGIN
SET f1 = 1 + f1;
RETURN f1;
END//
delimiter ;//
SELECT fn1( 126 );
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
......@@ -418,16 +502,16 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
CREATE FUNCTION fn1( f1 smallint ) returns smallint deterministic
BEGIN
set f1 = 1 + f1;
return f1;
CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT DETERMINISTIC
BEGIN
SET f1 = 1 + f1;
RETURN f1;
END//
delimiter ;//
SELECT fn1( 126 );
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
......@@ -435,16 +519,16 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
CREATE FUNCTION fn1( f1 smallint ) returns smallint not deterministic
BEGIN
set f1 = 1 + f1;
return f1;
CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT NOT DETERMINISTIC
BEGIN
SET f1 = 1 + f1;
RETURN f1;
END//
delimiter ;//
SELECT fn1( 126 );
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
......@@ -452,17 +536,16 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
CREATE FUNCTION fn1( f1 smallint ) returns smallint
sql security definer
BEGIN
set f1 = 1 + f1;
return f1;
CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT SQL SECURITY DEFINER
BEGIN
SET f1 = 1 + f1;
RETURN f1;
END//
delimiter ;//
SELECT fn1( 126 );
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
......@@ -470,17 +553,16 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
CREATE FUNCTION fn1( f1 smallint ) returns smallint
sql security invoker
CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT SQL SECURITY INVOKER
BEGIN
set f1 = 1 + f1;
return f1;
SET f1 = 1 + f1;
RETURN f1;
END//
delimiter ;//
SELECT fn1( 126 );
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
--disable_warnings
......@@ -488,16 +570,16 @@ DROP FUNCTION IF EXISTS fn1;
--enable_warnings
delimiter //;
CREATE FUNCTION fn1( f1 smallint ) returns smallint
comment 'this is simple'
CREATE FUNCTION fn1( f1 SMALLINT ) RETURNS SMALLINT COMMENT 'this is simple'
BEGIN
set f1 = 1 + f1;
return f1;
SET f1 = 1 + f1;
RETURN f1;
END//
delimiter ;//
SELECT fn1( 126 );
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
# cleanup
......@@ -517,7 +599,7 @@ DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1 (f1 char(20) )
SELECT * from t1 where f2 = f1;
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
show CREATE PROCEDURE sp1;
# cleanup
......@@ -536,7 +618,7 @@ DROP FUNCTION IF EXISTS fn1;
CREATE FUNCTION fn1 (s char(20)) returns char(50)
return concat('hello, ', s, '!');
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
show CREATE FUNCTION fn1;
# cleanup
......@@ -552,7 +634,7 @@ SHOW PROCEDURE status;
CREATE PROCEDURE sp5()
SELECT * from t1;
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE status like 'sp5';
# cleanup
......@@ -573,7 +655,7 @@ BEGIN
END//
delimiter ;//
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn5';
# cleanup
......@@ -762,7 +844,7 @@ disconnect u_1;
connection default;
--source suite/funcs_1/include/show_connection.inc
alter procedure sp11 sql security definer;
alter procedure sp11 sql security DEFINER;
--replace_column 13 created 14 modified
SELECT security_type from mysql.proc where specific_name='sp11';
CALL sp11();
......@@ -791,7 +873,7 @@ SELECT security_type from mysql.proc where specific_name='fn12';
--replace_column 13 created 14 modified
SELECT fn12();
alter function fn12 sql security definer;
alter function fn12 sql security DEFINER;
SELECT security_type from mysql.proc where specific_name='fn12';
--replace_column 13 created 14 modified
SELECT fn12();
......@@ -2494,12 +2576,12 @@ CALL db_storedproc.sp1();
SELECT db_storedproc.sp1();
USE db_storedproc;
alter procedure sp1 sql security definer;
alter procedure sp1 sql security DEFINER;
CALL db_storedproc.sp1();
SELECT db_storedproc.sp1();
alter function sp1 sql security definer;
alter function sp1 sql security DEFINER;
--sorted_result
SELECT name, type, security_type from mysql.proc where db LIKE 'db_storedproc%' and specific_name='sp1';
CALL db_storedproc.sp1();
......@@ -2527,8 +2609,8 @@ DROP DATABASE IF EXISTS db_storedproc_3122;
CREATE DATABASE db_storedproc_3122;
USE db_storedproc;
set @x=null;
set @y=null;
SET @x = NULL;
SET @y = NULL;
DROP PROCEDURE IF EXISTS sp1;
DROP FUNCTION IF EXISTS sp1;
DROP PROCEDURE IF EXISTS db_storedproc_3122.sp1;
......@@ -2536,13 +2618,13 @@ DROP FUNCTION IF EXISTS db_storedproc_3122.sp1;
delimiter //;
CREATE PROCEDURE sp1()
BEGIN
set @x= 1;
SET @x = 1;
SELECT @x;
END//
delimiter ;//
# FIXME ps-protocol vs. normal difference when returning float instead of double
CREATE FUNCTION db_storedproc_3122.sp1() returns double return 2.2;
CREATE FUNCTION db_storedproc_3122.sp1() RETURNS DOUBLE RETURN 2.2;
CALL sp1();
SELECT db_storedproc_3122.sp1();
USE db_storedproc_3122;
......@@ -2550,20 +2632,20 @@ CALL sp1();
delimiter //;
CREATE PROCEDURE sp1 ()
BEGIN
set @x= 3;
SET @x = 3;
SELECT @x;
END//
delimiter ;//
CREATE FUNCTION db_storedproc.sp1() returns double return 4.4;
CREATE FUNCTION db_storedproc.sp1() RETURNS DOUBLE RETURN 4.4;
CALL sp1();
SELECT db_storedproc.sp1();
alter procedure db_storedproc_3122.sp1 sql security invoker;
alter function sp1 sql security invoker;
ALTER PROCEDURE db_storedproc_3122.sp1 SQL SECURITY INVOKER;
ALTER FUNCTION sp1 SQL SECURITY INVOKER;
--sorted_result
SELECT db, name, type, security_type from mysql.proc where db LIKE 'db_storedproc%' and specific_name='sp1';
SELECT db, name, type, security_type FROM mysql.proc WHERE db LIKE 'db_storedproc%' AND specific_name='sp1';
CALL db_storedproc.sp1();
......@@ -2607,11 +2689,11 @@ CREATE FUNCTION sp1 () returns int return 4;
alter procedure sp1 sql security invoker comment 'this is a procedure';
alter function sp1 sql security invoker comment 'this is a function';
alter procedure sp1 sql security definer;
alter function sp1 sql security definer;
--replace_column 5 modified 6 created
alter procedure sp1 sql security DEFINER;
alter function sp1 sql security DEFINER;
--replace_column 5 <modified> 6 <created>
show CREATE PROCEDURE sp1;
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
show CREATE FUNCTION sp1;
# clean up
......@@ -16044,26 +16126,28 @@ let $message= Testcase 4.2.28:;
# declared within a stored procedures definition, as well as to every
# appropriate global server variable.
set @x=0;
set @y=0;
SET @x = 0;
SET @y = 0;
DROP PROCEDURE IF EXISTS sp1;
SET @start_global_value = @@GLOBAL.sort_buffer_size;
delimiter //;
CREATE PROCEDURE sp1()
BEGIN
declare continue handler for sqlstate '42000' set @x2 = 1;
set session sort_buffer_size = 10 * 1024 * 1024;
DECLARE CONTINUE HANDLER FOR SQLSTATE '42000' SET @x2 = 1;
SET SESSION SORT_BUFFER_SIZE = 10 * 1024 * 1024;
SELECT @@sort_buffer_size;
set @x = 4;
set @y = 3;
set global sort_buffer_size = 2 * 1024 * 1024;
SET @x = 4;
SET @y = 3;
SET GLOBAL SORT_BUFFER_SIZE = 2 * 1024 * 1024;
SELECT @@sort_buffer_size;
set @@sort_buffer_size = 10 * 1024 * 1024;
SET @@sort_buffer_size = 10 * 1024 * 1024;
SELECT @@sort_buffer_size;
END//
delimiter ;//
CALL sp1();
SELECT @x, @y;
SET @@GLOBAL.sort_buffer_size = @start_global_value;
# ------------------------------------------------------------------------------
......@@ -19541,11 +19625,11 @@ DROP DATABASE IF EXISTS d2;
USE d1;
CREATE PROCEDURE sp8 ( n char(20) ) sql security definer comment 'initial'
CREATE PROCEDURE sp8 ( n char(20) ) sql security DEFINER comment 'initial'
SELECT * from t1 where t1.f1 = n;
USE d2;
alter procedure d1.sp8 sql security definer comment 'updated';
alter procedure d1.sp8 sql security DEFINER comment 'updated';
--replace_column 13 modified 14 created
SELECT * from mysql.proc where specific_name='sp8' and db='d1';
......@@ -19574,7 +19658,7 @@ END//
delimiter ;//
USE d2;
alter function d1.fn2 sql security definer comment 'updated';
alter function d1.fn2 sql security DEFINER comment 'updated';
--replace_column 13 modified 14 created
SELECT * from mysql.proc where specific_name='fn2' and db='d1';
......@@ -26986,13 +27070,13 @@ show CREATE PROCEDURE sp6b;
show CREATE PROCEDURE sp6c;
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE status like 'sp6a';
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE status like 'sp6b';
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE status like 'sp6c';
# cleanup
......@@ -27020,7 +27104,7 @@ BEGIN
END//
delimiter ;//
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE status like 'sp6';
# cleanup
......@@ -27073,7 +27157,7 @@ CREATE FUNCTION sp6 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
END//
delimiter ;//
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
show function status like 'sp6';
# cleanup
......@@ -27154,7 +27238,7 @@ CREATE FUNCTION fn1 (i1 real) returns real
END//
delimiter ;//
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
show procedure status like 'fn1';
# cleanup
......@@ -27188,7 +27272,7 @@ BEGIN
END//
delimiter ;//
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
# cleanup
......@@ -27306,7 +27390,7 @@ BEGIN
END//
delimiter ;//
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
show function status like 'sp6';
# cleanup
......@@ -27347,7 +27431,7 @@ delimiter ;//
alter procedure sp6 comment 'this is a new comment';
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE status like 'sp6';
# cleanup
......@@ -27401,7 +27485,7 @@ delimiter ;//
alter function fn1 sql security invoker;
alter function fn1 comment 'this is a function 3242#@%$#@';
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
show function status like 'fn1';
# cleanup
......@@ -27481,7 +27565,7 @@ delimiter ;//
DROP PROCEDURE sp6;
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW PROCEDURE status like 'sp6';
......@@ -27530,7 +27614,7 @@ delimiter ;//
DROP FUNCTION fn1;
--replace_column 5 modified 6 created
--replace_column 5 <modified> 6 <created>
SHOW FUNCTION STATUS LIKE 'fn1';
......@@ -29297,11 +29381,11 @@ let $message= Testcase 4.11.40:;
--disable_warnings
DROP PROCEDURE IF EXISTS h1;
drop table IF EXISTS res_t1;
DROP TABLE IF EXISTS res_t1;
--enable_warnings
create table res_t1(w char unique, x char);
insert into res_t1 values ('a', 'b');
CREATE TABLE res_t1(w CHAR UNIQUE, x CHAR);
INSERT INTO res_t1 VALUES ('a', 'b');
# suppressed--error for having two similar handlers in the same scope
......@@ -29309,14 +29393,14 @@ delimiter //;
--error ER_SP_DUP_HANDLER
CREATE PROCEDURE h1 ()
BEGIN
declare x1, x2, x3, x4, x5 int default 0;
declare condname1 condition for sqlstate '42000';
declare condname2 condition for sqlstate '42000';
declare continue handler for condname1 set x1 = 1;
declare continue handler for condname1 set x2 = 1;
declare exit handler for condname1 set x3 = 1;
declare continue handler for condname2 set x4 = 1;
declare exit handler for condname2 set x5 = 1;
DECLARE x1, x2, x3, x4, x5 int default 0;
DECLARE condname1 CONDITION FOR SQLSTATE '42000';
DECLARE condname2 CONDITION FOR SQLSTATE '42000';
DECLARE CONTINUE HANDLER FOR condname1 set x1 = 1;
DECLARE CONTINUE HANDLER FOR condname1 set x2 = 1;
DECLARE EXIT HANDLER FOR condname1 SET x3 = 1;
DECLARE CONTINUE HANDLER FOR condname2 SET x4 = 1;
DECLARE EXIT HANDLER FOR condname2 SET x5 = 1;
END//
delimiter ;//
......@@ -29343,12 +29427,12 @@ DROP PROCEDURE IF EXISTS h1;
delimiter //;
CREATE PROCEDURE h1 ()
BEGIN
declare x1 int default 0;
DECLARE x1 INT DEFAULT 0;
BEGIN
declare condname1 condition for sqlstate '00000';
declare exit handler for sqlstate '00000' set @x = 1;
set x1 = 1;
set x1 = 2;
DECLARE condname1 CONDITION FOR SQLSTATE '00000';
DECLARE EXIT HANDLER FOR SQLSTATE '00000' SET @x = 1;
SET x1 = 1;
SET x1 = 2;
END;
SELECT @x, x1;
END//
......@@ -29379,10 +29463,10 @@ delimiter //;
CREATE PROCEDURE h1()
BEGIN
DECLARE EXIT HANDLER FOR SQLWARNING SET @done = 1;
set @done=0;
set @x=1;
insert into res_t1 values('xxx', 'yy');
set @x=0;
SET @done=0;
SET @x=1;
INSERT INTO res_t1 VALUES('xxx', 'yy');
SET @x=0;
END//
delimiter ;//
......@@ -29408,10 +29492,10 @@ delimiter //;
CREATE PROCEDURE h1()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLWARNING SET @done = 1;
set @done=0;
set @x=0;
insert into res_t1 values('xxx', 'yy');
set @x=1;
SET @done=0;
SET @x=0;
INSERT INTO res_t1 VALUES('xxx', 'yy');
SET @x=1;
END//
delimiter ;//
......
......@@ -158,10 +158,16 @@ DROP VIEW IF EXISTS v1;
--disable_query_log
# Storage for the SELECTs to be used for the VIEW definition
# Attention: my_select must be no too small because a statement like
# SELECT LOAD_FILE(< file in MYSQLTEST_VARDIR >)
# AS my_col,
# id FROM t1_values';
# might be a very long
# Bug#38427 "Data too long" ... tests "<ENGINE>_func_view" fail
CREATE TABLE t1_selects
(
id BIGINT AUTO_INCREMENT,
my_select VARCHAR(200) NOT NULL,
my_select VARCHAR(1000) NOT NULL,
disable_result ENUM('Yes','No') NOT NULL default 'No',
PRIMARY KEY(id),
UNIQUE (my_select)
......
--source include/have_bug25714.inc
source include/federated.inc;
connection default;
connection master;
# Disable concurrent inserts to avoid test failures when reading
# data from concurrent connections (insert might return before
# the data is actually in the table).
SET @OLD_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @OLD_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= 0;
connection slave;
SET @OLD_SLAVE_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= 0;
--disable_warnings
DROP TABLE IF EXISTS federated.bug_13118_table;
--enable_warnings
......@@ -46,11 +47,12 @@ SELECT LAST_INSERT_ID();
SELECT * from federated.t1;
DROP TABLE federated.t1;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
connection slave;
DROP TABLE federated.t1;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
source include/federated_cleanup.inc;
connection default;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_CONCURRENT_INSERT;
############# mysql-test\t\SLOW_LAUNCH_time_func.test ##########################
############# mysql-test\t\slow_launch_time_func.test ##########################
# #
# Variable Name: slow_launch_time #
# Scope: SESSION #
......@@ -11,11 +11,17 @@
# Creation Date: 2008-03-02 #
# Author: Sharique Abdullah #
# #
# Last change: 2008-09-09 mleich Reimplementation of this test #
# - Fix Bug#36874 : main.slow_launch_time_func test fails #
# randomly #
# - Fix other failures and streamline the test #
# #
# Description: Test Cases of Dynamic System Variable "slow_launch_time " #
# that checks behavior of this variable in the following ways #
# * Functionality based on different values #
# #
#Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#
# Reference: #
# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# option_mysqld_slow_launch_time #
# #
################################################################################
......@@ -28,82 +34,71 @@
SET @global_slow_launch_time = @@GLOBAL.slow_launch_time;
--echo ** Connection default **
connection default;
--echo '#--------------------FN_DYNVARS_124_01-------------------------#'
#####################################
# Increase number of connection #
#####################################
--echo ** Connection default **
connection default;
########################################################################
# Reveal that a new connect gets counted as "slow launched thread" if #
# @@GLOBAL.slow_launch_time = 0. #
# The value of slow_launch_threads must be increased by 1. #
########################################################################
SET @@GLOBAL.slow_launch_time=0;
SELECT @@GLOBAL.slow_launch_time;
--echo ** Connecting conn5 using username 'root' **
CONNECT (conn5,localhost,root,,);
--echo ** Connecting conn6 using username 'root' **
CONNECT (conn6,localhost,root,,);
--echo ** Connecting conn7 using username 'root' **
CONNECT (conn7,localhost,root,,);
--echo ** Connecting conn8 using username 'root' **
CONNECT (conn8,localhost,root,,);
--echo ** Connecting conn9 using username 'root' **
CONNECT (conn9,localhost,root,,);
--echo ** Connecting conn10 using username 'root' **
CONNECT (conn10,localhost,root,,);
--echo ** Connecting conn11 using username 'root' **
CONNECT (conn11,localhost,root,,);
--echo ** Connecting conn12 using username 'root' **
CONNECT (conn12,localhost,root,,);
--echo ** Connecting conn13 using username 'root' **
CONNECT (conn13,localhost,root,,);
--echo ** Connecting conn14 using username 'root' **
CONNECT (conn14,localhost,root,,);
--echo ** Connecting conn15 using username 'root' **
CONNECT (conn15,localhost,root,,);
--echo ** Connecting conn16 using username 'root' **
CONNECT (conn16,localhost,root,,);
let $value_before=
query_get_value(show status like 'slow_launch_threads', Value, 1);
--echo ** Connecting conn1 using username 'root' **
CONNECT (conn1,localhost,root,,);
let $value_after=
query_get_value(show status like 'slow_launch_threads', Value, 1);
if (!`SELECT $value_after = $value_before + 1`)
{
--echo ERROR: Subtest FN_DYNVARS_124_01 failed
--echo A new connect should be counted as 'slow_launch_thread' if
--echo @@GLOBAL.slow_launch_time=0
SELECT @@GLOBAL.slow_launch_time;
echo Number of slow_launch_threads before new connect: $value_before;
echo Number of slow_launch_threads after new connect: $value_after;
}
--echo ** Switch to connection default and disconnect conn1 **
connection default;
disconnect conn1;
--echo '#--------------------FN_DYNVARS_124_02-------------------------#'
########################################################################
# Reveal that a new connect gets not counted as "slow launched thread" #
# if @@GLOBAL.slow_launch_time is sufficient big. #
# The value of slow_launch_threads must not change. #
########################################################################
#
# Checking status of slow_launch_threads
#
SET @@GLOBAL.slow_launch_time= 1000;
SELECT @@GLOBAL.slow_launch_time;
show status like 'slow_launch_threads';
--echo 12 Expected
let $value_before=
query_get_value(show status like 'slow_launch_threads', Value, 1);
--echo ** Connecting conn2 using username 'root' **
CONNECT (conn2,localhost,root,,);
let $value_after=
query_get_value(show status like 'slow_launch_threads', Value, 1);
if (!`SELECT $value_after = $value_before`)
{
--echo ERROR: Subtest FN_DYNVARS_124_02 failed
--echo A new connect must not be counted as 'slow_launch_thread' if
--echo @@GLOBAL.slow_launch_time is sufficient big.
SELECT @@GLOBAL.slow_launch_time;
echo Number of slow_launch_threads before new connect: $value_before;
echo Number of slow_launch_threads after new connect: $value_after;
}
#
# Cleanup
#
--echo ** Connection default **
--echo ** Switch to connection default and disconnect conn2 **
connection default;
--echo ** Disconnecting conn5 **
disconnect conn5;
--echo ** Disconnecting conn6 **
disconnect conn6;
--echo ** Disconnecting conn7 **
disconnect conn7;
--echo ** Disconnecting conn8 **
disconnect conn8;
--echo ** Disconnecting conn9 **
disconnect conn9;
--echo ** Disconnecting conn10 **
disconnect conn10;
--echo ** Disconnecting conn11 **
disconnect conn11;
--echo ** Disconnecting conn12 **
disconnect conn12;
--echo ** Disconnecting conn13 **
disconnect conn13;
--echo ** Disconnecting conn14 **
disconnect conn14;
--echo ** Disconnecting conn15 **
disconnect conn15;
--echo ** Disconnecting conn16 **
disconnect conn16;
disconnect conn2;
SET @@GLOBAL.slow_launch_time = @global_slow_launch_time;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment