Commit ebfad22d authored by Ingo Struewing's avatar Ingo Struewing
Browse files

merge

parents 3ea68493 042b9c30
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ EXPORTS
	dynstr_append_mem
	init_dynamic_string
	dynstr_free
	hash_free
	my_hash_free
	my_vsnprintf
	dynstr_append
	my_close
@@ -31,7 +31,7 @@ EXPORTS
	fn_format
	dirname_part
	my_hash_insert
	hash_search
	my_hash_search
	test_if_hard_path
	my_copy
	my_mkdir
@@ -54,7 +54,7 @@ EXPORTS
	my_thread_stack_size
	my_safe_print_str
	my_stat
	_hash_init
	_my_hash_init
	pthread_attr_setstacksize
	pthread_attr_init
	my_dirend
+32 −0
Original line number Diff line number Diff line
@@ -1848,3 +1848,35 @@ select hex(_utf8 B'001111111111');
ERROR HY000: Invalid utf8 character string: 'FF'
select (_utf8 X'616263FF');
ERROR HY000: Invalid utf8 character string: 'FF'
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL);
INSERT INTO t1 VALUES (70000, 1092), (70001, 1085), (70002, 1065);
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
CONVERT(a, CHAR)	CONVERT(b, CHAR)
70002	1065
70001	1085
70000	1092
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1;
CONVERT(a, CHAR)	CONVERT(b, CHAR)
70000	1092
70001	1085
70002	1065
ALTER TABLE t1 ADD UNIQUE (b);
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
CONVERT(a, CHAR)	CONVERT(b, CHAR)
70002	1065
70001	1085
70000	1092
DROP INDEX b ON t1;
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
CONVERT(a, CHAR)	CONVERT(b, CHAR)
70002	1065
70001	1085
70000	1092
ALTER TABLE t1 ADD INDEX (b);
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) from t1 GROUP BY b;
CONVERT(a, CHAR)	CONVERT(b, CHAR)
70002	1065
70001	1085
70000	1092
DROP TABLE t1;
End of 5.0 tests
+30 −28
Original line number Diff line number Diff line
drop table if exists t1;
## Creating new table t1 ##
CREATE TABLE t1
(
id INT NOT NULL auto_increment,
PRIMARY KEY (id),
name VARCHAR(30)
);
SET @start_value= @@global.wait_timeout;
'#--------------------FN_DYNVARS_186_01-------------------------#'
## Creating new connection test_con1 ## 
## Setting value of variable to 5 ##
SET @@session.wait_timeout = 5;
## Inserting record in table t1 ##
INSERT into t1(name) values('Record_1');
## Using sleep to check timeout ## 
'#--------------------FN_DYNVARS_186_02-------------------------#'
## Setting value of variable ##
SET @@global.wait_timeout = 5;
## Creating new connection test_con2 ## 
INSERT into t1(name) values('Record_2');
## Using sleep to check timeout ## 
SET @start_time= UNIX_TIMESTAMP();
connect (test_con1, localhost, root,,);
SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';
Expect 1
1
SET @@session.wait_timeout = <session_value>;
connect (test_con2, localhost, root,,);
SET @@session.wait_timeout = <session_value> - 1;
connection default;
wait until connections ready
SELECT info FROM information_schema.processlist;
info
SELECT info FROM information_schema.processlist
'#--------------------FN_DYNVARS_186_03-------------------------#'
## Setting value of variable to 1 ##
SET @@global.wait_timeout = 1;
## Creating new connection ## 
INSERT into t1(name) values('Record_3');
## Using sleep to check timeout ##
## We cannot test it further because the server stops due to wait_timeout ## 
SELECT * from t1;
ERROR HY000: MySQL server has gone away
SET @@global.wait_timeout= <global_value>;
SELECT @@session.wait_timeout = @start_value AS 'Expect 1';
Expect 1
1
connect (test_con3, localhost, root,,);
SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';
Expect 1
1
connection default;
SELECT info FROM information_schema.processlist;
info
SELECT info FROM information_schema.processlist
SELECT UNIX_TIMESTAMP() - @start_time >= <global_value> + <session_value>;;
UNIX_TIMESTAMP() - @start_time >= <global_value> + <session_value>;
1
SET @@global.wait_timeout= @start_value;
+17 −0
Original line number Diff line number Diff line
@@ -1439,3 +1439,20 @@ select hex(_utf8 X'616263FF');
select hex(_utf8 B'001111111111');
--error ER_INVALID_CHARACTER_STRING
select (_utf8 X'616263FF');

#
# Bug #36772: When using UTF8, CONVERT with GROUP BY returns truncated results
#
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL);
INSERT INTO t1 VALUES (70000, 1092), (70001, 1085), (70002, 1065);
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1;
ALTER TABLE t1 ADD UNIQUE (b);
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
DROP INDEX b ON t1;
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
ALTER TABLE t1 ADD INDEX (b);
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) from t1 GROUP BY b;
DROP TABLE t1;

--echo End of 5.0 tests
+50 −56
Original line number Diff line number Diff line
@@ -11,93 +11,87 @@
# Creation Date: 2008-03-07                                                   #
# Author:  Salman Rawala                                                      #
#                                                                             #
# Modified: HHunger 2008-08-27 Simplified the test and replaced the sleeps.   #
#                                                                             #
# Description: Test Cases of Dynamic System Variable wait_timeout             #
#              that checks the functionality of this variable                 #
#                                                                             #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
#  server-system-variables.html#option_mysqld_wait_timeouts                   #
# Reference:                                                                  #
#  http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html        #
#                                                                             #
###############################################################################

--source include/not_embedded.inc

--disable_warnings
drop table if exists t1;
--enable_warnings

##############################
#   Creating two new tables  #
##############################

--echo ## Creating new table t1 ##
CREATE TABLE t1
(
id INT NOT NULL auto_increment,
PRIMARY KEY (id),
name VARCHAR(30)
);
SET @start_value= @@global.wait_timeout;


--echo '#--------------------FN_DYNVARS_186_01-------------------------#'
#######################################################################
#   Setting initial value of interactive_timeout greater than sleep and
#   verifying its behavior on session scope
# 1. test of scope session
#######################################################################

--echo ## Creating new connection test_con1 ## 
SET @start_time= UNIX_TIMESTAMP();
--echo connect (test_con1, localhost, root,,);
connect (test_con1, localhost, root,,);
connection test_con1;

--echo ## Setting value of variable to 5 ##
SET @@session.wait_timeout = 5;

--echo ## Inserting record in table t1 ##
INSERT into t1(name) values('Record_1');

--echo ## Using sleep to check timeout ## 
sleep 4;


--echo '#--------------------FN_DYNVARS_186_02-------------------------#'
#######################################################################
#   Setting initial value of interactive_timeout greater than sleep and
#   verifying its behavior on global scope
#######################################################################
# If not explicitly changed, @@session.wait_timeout equals @@global.wait_timeout.
SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';

--echo ## Setting value of variable ##
SET @@global.wait_timeout = 5;
# Find a small value <> @@global.wait_timeout.
let $session_value =
`SELECT IF(@@global.wait_timeout <> 2 OR @@global.wait_timeout IS NULL, 2, 3)`;
--replace_result $session_value <session_value>
eval SET @@session.wait_timeout = $session_value;

--echo ## Creating new connection test_con2 ## 
--echo connect (test_con2, localhost, root,,);
connect (test_con2, localhost, root,,);
connection test_con2;

INSERT into t1(name) values('Record_2');

--echo ## Using sleep to check timeout ## 
sleep 4;

--replace_result $session_value <session_value>
eval SET @@session.wait_timeout = $session_value - 1;

--echo connection default;
connection default;

--echo wait until connections ready
let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist;
--source include/wait_condition.inc
SELECT info FROM information_schema.processlist;

--echo '#--------------------FN_DYNVARS_186_03-------------------------#'
#######################################################################
#   Setting initial value of interactive_timeout less than sleep and
#   verifying its behavior on global scope
# 2. test of scope global
#######################################################################

--echo ## Setting value of variable to 1 ##
SET @@global.wait_timeout = 1;
# Find a small value <> @@global.wait_timeout.
let $global_value = $session_value + 1;
--replace_result $global_value <global_value>
eval SET @@global.wait_timeout= $global_value;

--echo ## Creating new connection ## 
# Changing the @@global.wait_timeout has no influence on the
# @@session.wait_timeout of already established sessions.
SELECT @@session.wait_timeout = @start_value AS 'Expect 1';

--echo connect (test_con3, localhost, root,,);
connect (test_con3, localhost, root,,);
connection test_con3;

INSERT into t1(name) values('Record_3');

--echo ## Using sleep to check timeout ##
sleep 5;

--echo ## We cannot test it further because the server stops due to wait_timeout ## 
--Error 2006
SELECT * from t1;
# If not explicitly changed, @@session.wait_timeout equals @@global.wait_timeout.
SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';

--echo connection default;
connection default;
# We can be sure that the connections test_con1 and test_con2 must be
# established because both have already executed a SET @@session.wait_timeout.
# This means they are or at least were visible within the processlist.
# Therefore we can now simply wait till both disappear from the processlist.
let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist;
--source include/wait_condition.inc
SELECT info FROM information_schema.processlist;

--replace_result $global_value <global_value> $session_value <session_value>;
eval SELECT UNIX_TIMESTAMP() - @start_time >= $global_value + $session_value;
SET @@global.wait_timeout= @start_value;
Loading