Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
7fe7e431
Commit
7fe7e431
authored
May 30, 2008
by
Patrick Crews
Browse files
Options
Browse Files
Download
Plain Diff
automatically merged
parents
ae408f63
7b62ee3e
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
252 additions
and
332 deletions
+252
-332
mysql-test/r/func_misc.result
mysql-test/r/func_misc.result
+85
-62
mysql-test/t/func_misc.test
mysql-test/t/func_misc.test
+167
-270
No files found.
mysql-test/r/func_misc.result
View file @
7fe7e431
...
@@ -104,76 +104,99 @@ t1 CREATE TABLE `t1` (
...
@@ -104,76 +104,99 @@ t1 CREATE TABLE `t1` (
`length(uuid())` int(10) NOT NULL DEFAULT '0'
`length(uuid())` int(10) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
drop table t1;
create table t1 (id int,
#------------------------------------------------------------------------
a timestamp default '2005-05-05 01:01:01',
# Tests for Bug#6760 and Bug#12689
b timestamp default '2005-05-05 01:01:01');
SET @row_count = 4;
insert into t1 set id = 1,a = now();
SET @sleep_time_per_result_row = 1;
select sleep(3);
SET @max_acceptable_delay = 2;
sleep(3)
0
update t1 set b = now() where id = 1;
insert into t1 set id = 2,a = now();
select sleep(3);
sleep(3)
0
update t1 set b = now() where id = 2;
select count(*) >= 1 from t1
where timediff(b, a) between '00:00:03' and '00:00:07';
count(*) >= 1
1
drop table t1;
SET @@global.query_cache_size = 1024 * 64;
SET @@global.query_cache_size = 1024 * 64;
SELECT 1 as some_value, sleep(1);
DROP TEMPORARY TABLE IF EXISTS t_history;
some_value sleep(1)
DROP TABLE IF EXISTS t1;
1 0
CREATE TEMPORARY TABLE t_history (attempt SMALLINT,
SELECT <Qcache_queries_in_cache_before> = <Qcache_queries_in_cache_before>
start_ts DATETIME, end_ts DATETIME,
AS "Was the query not cached (= expectation)?";
start_cached INTEGER, end_cached INTEGER);
Was the query not cached (= expectation)?
1
DROP TEMPORARY TABLE IF EXISTS proclist_history;
DROP TABLE IF EXISTS t1;
CREATE TEMPORARY TABLE proclist_history AS
SELECT 'Bug 1' AS test, 0 AS attempt, NOW() AS observation_time, state, time
FROM information_schema.processlist WHERE 1 = 0;
CREATE TABLE t1 (f1 BIGINT);
CREATE TABLE t1 (f1 BIGINT);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (1);
SET @sleep_time_per_result_row = 1;
INSERT INTO t_history
----- establish connection con1 (user = root) -----
SET attempt = 4 - 4 + 1, start_ts = NOW(),
SET @sleep_time_per_result_row = 1;
start_cached = 0;
Qcache_queries_in_cache: 0
SELECT *, SLEEP(@sleep_time_per_result_row) FROM t1;
#
Send query with send, pull server responses later
f1 SLEEP(@sleep_time_per_result_row)
SELECT sleep(@sleep_time_per_result_row) FROM t1;
1 0
----- switch to connection default (user = root) -----
1 0
----- switch to connection con1 (user = root) -----
1 0
#
Pull server responses of last query
1 0
sleep(@sleep_time_per_result_row)
UPDATE t_history SET end_ts = NOW()
0
WHERE attempt = 4 - 4 + 1;
0
UPDATE t_history SET end_cached = 0
0
WHERE attempt = 4 - 4 + 1;
0
INSERT INTO t_history
----- switch to connection con1 (user = root) -----
SET attempt = 4 - 3 + 1, start_ts = NOW(),
#
Send query with send, pull server responses later
start_cached = 0;
SELECT sleep(@sleep_time_per_result_row) FROM t1;
SELECT *, SLEEP(@sleep_time_per_result_row) FROM t1;
----- switch to connection default (user = root) -----
f1 SLEEP(@sleep_time_per_result_row)
SELECT COUNT(*) FROM information_schema.processlist
1 0
WHERE info = 'SELECT sleep(@sleep_time_per_result_row) FROM t1'
1 0
AND state = 'User sleep';
1 0
COUNT(*)
1 0
UPDATE t_history SET end_ts = NOW()
WHERE attempt = 4 - 3 + 1;
UPDATE t_history SET end_cached = 0
WHERE attempt = 4 - 3 + 1;
INSERT INTO t_history
SET attempt = 4 - 2 + 1, start_ts = NOW(),
start_cached = 0;
SELECT *, SLEEP(@sleep_time_per_result_row) FROM t1;
f1 SLEEP(@sleep_time_per_result_row)
1 0
1 0
1 0
1 0
UPDATE t_history SET end_ts = NOW()
WHERE attempt = 4 - 2 + 1;
UPDATE t_history SET end_cached = 0
WHERE attempt = 4 - 2 + 1;
INSERT INTO t_history
SET attempt = 4 - 1 + 1, start_ts = NOW(),
start_cached = 0;
SELECT *, SLEEP(@sleep_time_per_result_row) FROM t1;
f1 SLEEP(@sleep_time_per_result_row)
1 0
1 0
1 0
1 0
UPDATE t_history SET end_ts = NOW()
WHERE attempt = 4 - 1 + 1;
UPDATE t_history SET end_cached = 0
WHERE attempt = 4 - 1 + 1;
# Test 1: Does the query with SLEEP need a reasonable time?
SELECT COUNT(*) > 4 - 1 INTO @aux1 FROM t_history
WHERE TIMEDIFF(end_ts,start_ts) - @sleep_time_per_result_row * @row_count
BETWEEN 0 AND @max_acceptable_delay;
SELECT @aux1 AS "Expect 1";
Expect 1
1
# Test 2: Does the query with SLEEP need a reasonable time even in case
# of the non first execution?
SELECT COUNT(*) > 4 - 1 - 1 INTO @aux2 FROM t_history
WHERE TIMEDIFF(end_ts,start_ts) - @sleep_time_per_result_row * @row_count
BETWEEN 0 AND @max_acceptable_delay
AND attempt > 1;
SELECT @aux2 AS "Expect 1";
Expect 1
1
# Test 3: The query with SLEEP must be not cached.
SELECT COUNT(*) = 4 INTO @aux3 FROM t_history
WHERE end_cached = start_cached;
SELECT @aux3 AS "Expect 1";
Expect 1
1
1
----- switch to connection con1 (user = root) -----
#
Pull server responses of last query
sleep(@sleep_time_per_result_row)
0
0
0
0
----- switch to connection default and close connection con1 -----
SET @@global.query_cache_size = default;
DROP TABLE t1;
DROP TABLE t1;
DROP TEMPORARY TABLE proclist_history;
DROP TEMPORARY TABLE t_history;
SET @@global.query_cache_size = default;
create table t1 select INET_ATON('255.255.0.1') as `a`;
create table t1 select INET_ATON('255.255.0.1') as `a`;
show create table t1;
show create table t1;
Table Create Table
Table Create Table
...
...
mysql-test/t/func_misc.test
View file @
7fe7e431
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment