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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
dab998d0
Commit
dab998d0
authored
Sep 03, 2012
by
Elena Stepanova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preliminary test case for MDEV-504 in order to reproduce the problem
parent
cfde11fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
0 deletions
+96
-0
mysql-test/r/mdev-504.result
mysql-test/r/mdev-504.result
+21
-0
mysql-test/t/mdev-504.test
mysql-test/t/mdev-504.test
+75
-0
No files found.
mysql-test/r/mdev-504.result
0 → 100644
View file @
dab998d0
CREATE TABLE A (
pk INTEGER AUTO_INCREMENT PRIMARY KEY,
fdate DATE
) ENGINE=MyISAM;
CREATE PROCEDURE p_analyze()
BEGIN
DECLARE attempts INTEGER DEFAULT 100;
wl_loop: WHILE attempts > 0 DO
ANALYZE TABLE A;
SET attempts = attempts - 1;
END WHILE wl_loop;
END |
CREATE FUNCTION rnd3() RETURNS INT
BEGIN
RETURN ROUND(3 * RAND() + 0.5);
END |
SET GLOBAL use_stat_tables = PREFERABLY;
DROP TABLE A;
DROP PROCEDURE p_analyze;
DROP FUNCTION rnd3;
SET GLOBAL use_stat_tables = DEFAULT;
mysql-test/t/mdev-504.test
0 → 100644
View file @
dab998d0
CREATE
TABLE
A
(
pk
INTEGER
AUTO_INCREMENT
PRIMARY
KEY
,
fdate
DATE
)
ENGINE
=
MyISAM
;
--
delimiter
|
CREATE
PROCEDURE
p_analyze
()
BEGIN
DECLARE
attempts
INTEGER
DEFAULT
100
;
wl_loop
:
WHILE
attempts
>
0
DO
ANALYZE
TABLE
A
;
SET
attempts
=
attempts
-
1
;
END
WHILE
wl_loop
;
END
|
CREATE
FUNCTION
rnd3
()
RETURNS
INT
BEGIN
RETURN
ROUND
(
3
*
RAND
()
+
0.5
);
END
|
--
delimiter
;
SET
GLOBAL
use_stat_tables
=
PREFERABLY
;
--
let
$trial
=
100
--
disable_query_log
--
disable_result_log
--
disable_warnings
while
(
$trial
)
{
--
connect
(
con1
,
localhost
,
root
,,)
--
send
CALL
p_analyze
()
--
connect
(
con2
,
localhost
,
root
,,)
--
send
CALL
p_analyze
()
--
let
$run
=
100
while
(
$run
)
{
--
connect
(
con3
,
localhost
,
root
,,)
let
$query
=
`SELECT CASE rnd3()
WHEN 1 THEN 'INSERT INTO A (pk) VALUES (NULL)'
WHEN 2 THEN 'DELETE FROM A LIMIT 1'
ELSE 'UPDATE A SET fdate = 2 LIMIT 1' END`
;
--
eval
$query
--
disconnect
con3
--
dec
$run
}
--
connection
con2
--
reap
--
disconnect
con2
--
connection
con1
--
reap
--
disconnect
con1
--
dec
$trial
}
--
enable_query_log
--
enable_result_log
--
enable_warnings
# Cleanup
--
connection
default
DROP
TABLE
A
;
DROP
PROCEDURE
p_analyze
;
DROP
FUNCTION
rnd3
;
SET
GLOBAL
use_stat_tables
=
DEFAULT
;
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