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
42cc59a8
Commit
42cc59a8
authored
May 27, 2011
by
Igor Babaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backported the test case for bug 43618 from mysql code line.
parent
d86ad186
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
149 additions
and
0 deletions
+149
-0
mysql-test/include/icp_tests.inc
mysql-test/include/icp_tests.inc
+41
-0
mysql-test/r/innodb_icp.result
mysql-test/r/innodb_icp.result
+36
-0
mysql-test/r/maria_icp.result
mysql-test/r/maria_icp.result
+36
-0
mysql-test/r/myisam_icp.result
mysql-test/r/myisam_icp.result
+36
-0
No files found.
mysql-test/include/icp_tests.inc
View file @
42cc59a8
...
...
@@ -138,6 +138,47 @@ ORDER BY c2 DESC LIMIT 2;
--
echo
DROP
TABLE
t1
;
--
echo
#
--
echo
# BUG#43618: MyISAM&Maria returns wrong results with 'between'
--
echo
# on timestamp
--
echo
#
CREATE
TABLE
t1
(
ts
TIMESTAMP
NOT
NULL
,
c
char
NULL
,
PRIMARY
KEY
(
ts
)
);
INSERT
INTO
t1
VALUES
(
'1971-01-01'
,
'a'
),
(
'2007-05-25'
,
'b'
),
(
'2008-01-01'
,
'c'
),
(
'2038-01-09'
,
'd'
);
--
disable_warnings
--
echo
--
echo
# Execute select with invalid timestamp, desc ordering
SELECT
*
FROM
t1
WHERE
ts
BETWEEN
'0000-00-00'
AND
'2010-00-01 00:00:00'
ORDER
BY
ts
DESC
LIMIT
2
;
--
echo
--
echo
# Should use index condition
EXPLAIN
SELECT
*
FROM
t1
WHERE
ts
BETWEEN
'0000-00-00'
AND
'2010-00-01 00:00:00'
ORDER
BY
ts
DESC
LIMIT
2
;
--
echo
--
enable_warnings
DROP
TABLE
t1
;
--
echo
#
--
echo
# BUG#49906: Assertion failed - Field_varstring::val_str in field.cc
--
echo
# (Note: Fixed by patch for LP BUG#625841)
...
...
mysql-test/r/innodb_icp.result
View file @
42cc59a8
...
...
@@ -131,6 +131,42 @@ ORDER BY c2 DESC LIMIT 2;
c1 c2 c3 c4
2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00
DROP TABLE t1;
#
# BUG#43618: MyISAM&Maria returns wrong results with 'between'
# on timestamp
#
CREATE TABLE t1(
ts TIMESTAMP NOT NULL,
c char NULL,
PRIMARY KEY(ts)
);
INSERT INTO t1 VALUES
('1971-01-01','a'),
('2007-05-25','b'),
('2008-01-01','c'),
('2038-01-09','d');
# Execute select with invalid timestamp, desc ordering
SELECT *
FROM t1
WHERE ts BETWEEN '0000-00-00' AND '2010-00-01 00:00:00'
ORDER BY ts DESC
LIMIT 2;
ts c
2008-01-01 00:00:00 c
2007-05-25 00:00:00 b
# Should use index condition
EXPLAIN
SELECT *
FROM t1
WHERE ts BETWEEN '0000-00-00' AND '2010-00-01 00:00:00'
ORDER BY ts DESC
LIMIT 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using index condition
DROP TABLE t1;
#
# BUG#49906: Assertion failed - Field_varstring::val_str in field.cc
...
...
mysql-test/r/maria_icp.result
View file @
42cc59a8
...
...
@@ -131,6 +131,42 @@ ORDER BY c2 DESC LIMIT 2;
c1 c2 c3 c4
2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00
DROP TABLE t1;
#
# BUG#43618: MyISAM&Maria returns wrong results with 'between'
# on timestamp
#
CREATE TABLE t1(
ts TIMESTAMP NOT NULL,
c char NULL,
PRIMARY KEY(ts)
);
INSERT INTO t1 VALUES
('1971-01-01','a'),
('2007-05-25','b'),
('2008-01-01','c'),
('2038-01-09','d');
# Execute select with invalid timestamp, desc ordering
SELECT *
FROM t1
WHERE ts BETWEEN '0000-00-00' AND '2010-00-01 00:00:00'
ORDER BY ts DESC
LIMIT 2;
ts c
2008-01-01 00:00:00 c
2007-05-25 00:00:00 b
# Should use index condition
EXPLAIN
SELECT *
FROM t1
WHERE ts BETWEEN '0000-00-00' AND '2010-00-01 00:00:00'
ORDER BY ts DESC
LIMIT 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 4 Using index condition
DROP TABLE t1;
#
# BUG#49906: Assertion failed - Field_varstring::val_str in field.cc
...
...
mysql-test/r/myisam_icp.result
View file @
42cc59a8
...
...
@@ -129,6 +129,42 @@ ORDER BY c2 DESC LIMIT 2;
c1 c2 c3 c4
2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00
DROP TABLE t1;
#
# BUG#43618: MyISAM&Maria returns wrong results with 'between'
# on timestamp
#
CREATE TABLE t1(
ts TIMESTAMP NOT NULL,
c char NULL,
PRIMARY KEY(ts)
);
INSERT INTO t1 VALUES
('1971-01-01','a'),
('2007-05-25','b'),
('2008-01-01','c'),
('2038-01-09','d');
# Execute select with invalid timestamp, desc ordering
SELECT *
FROM t1
WHERE ts BETWEEN '0000-00-00' AND '2010-00-01 00:00:00'
ORDER BY ts DESC
LIMIT 2;
ts c
2008-01-01 00:00:00 c
2007-05-25 00:00:00 b
# Should use index condition
EXPLAIN
SELECT *
FROM t1
WHERE ts BETWEEN '0000-00-00' AND '2010-00-01 00:00:00'
ORDER BY ts DESC
LIMIT 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 4 Using index condition
DROP TABLE t1;
#
# BUG#49906: Assertion failed - Field_varstring::val_str in field.cc
...
...
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