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
170f4910
Commit
170f4910
authored
Apr 18, 2011
by
Martin Hansson
Browse files
Options
Browse Files
Download
Plain Diff
Merge of test case for bug#11758558 - 50774
parents
cf21a2d2
8dabe8aa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
110 additions
and
0 deletions
+110
-0
mysql-test/r/type_timestamp.result
mysql-test/r/type_timestamp.result
+63
-0
mysql-test/t/type_timestamp.test
mysql-test/t/type_timestamp.test
+47
-0
No files found.
mysql-test/r/type_timestamp.result
View file @
170f4910
...
...
@@ -523,6 +523,69 @@ a
2000-01-01 00:00:01
2000-01-01 00:00:01
DROP TABLE t1;
#
# Bug#50774: failed to get the correct resultset when timestamp values
# are appended with .0
#
CREATE TABLE t1 ( a TIMESTAMP, KEY ( a ) );
INSERT INTO t1 VALUES( '2010-02-01 09:31:01' );
INSERT INTO t1 VALUES( '2010-02-01 09:31:02' );
INSERT INTO t1 VALUES( '2010-02-01 09:31:03' );
INSERT INTO t1 VALUES( '2010-02-01 09:31:04' );
SELECT * FROM t1 WHERE a >= '2010-02-01 09:31:02.0';
a
2010-02-01 09:31:02
2010-02-01 09:31:03
2010-02-01 09:31:04
SELECT * FROM t1 WHERE '2010-02-01 09:31:02.0' <= a;
a
2010-02-01 09:31:02
2010-02-01 09:31:03
2010-02-01 09:31:04
SELECT * FROM t1 WHERE a <= '2010-02-01 09:31:02.0';
a
2010-02-01 09:31:01
2010-02-01 09:31:02
SELECT * FROM t1 WHERE '2010-02-01 09:31:02.0' >= a;
a
2010-02-01 09:31:01
2010-02-01 09:31:02
EXPLAIN
SELECT * FROM t1 WHERE a >= '2010-02-01 09:31:02.0';
id select_type table type possible_keys key key_len ref rows Extra
x x x range x x x x x x
SELECT * FROM t1 WHERE a >= '2010-02-01 09:31:02.0';
a
2010-02-01 09:31:02
2010-02-01 09:31:03
2010-02-01 09:31:04
CREATE TABLE t2 ( a TIMESTAMP, KEY ( a DESC ) );
INSERT INTO t2 VALUES( '2010-02-01 09:31:01' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:02' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:03' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:04' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:05' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:06' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:07' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:08' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:09' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:10' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:11' );
# The bug would cause the range optimizer's comparison to use an open
# interval here. This reveals itself only in the number of reads
# performed.
FLUSH STATUS;
EXPLAIN
SELECT * FROM t2 WHERE a < '2010-02-01 09:31:02.0';
id select_type table type possible_keys key key_len ref rows Extra
x x x range x x x x x x
SELECT * FROM t2 WHERE a < '2010-02-01 09:31:02.0';
a
2010-02-01 09:31:01
SHOW STATUS LIKE 'Handler_read_next';
Variable_name Value
Handler_read_next 1
DROP TABLE t1, t2;
End of 5.1 tests
Bug#50888 valgrind warnings in Field_timestamp::val_str
...
...
mysql-test/t/type_timestamp.test
View file @
170f4910
...
...
@@ -362,6 +362,53 @@ SELECT a FROM t1 WHERE a >= '20000101000000';
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#50774: failed to get the correct resultset when timestamp values
--
echo
# are appended with .0
--
echo
#
CREATE
TABLE
t1
(
a
TIMESTAMP
,
KEY
(
a
)
);
INSERT
INTO
t1
VALUES
(
'2010-02-01 09:31:01'
);
INSERT
INTO
t1
VALUES
(
'2010-02-01 09:31:02'
);
INSERT
INTO
t1
VALUES
(
'2010-02-01 09:31:03'
);
INSERT
INTO
t1
VALUES
(
'2010-02-01 09:31:04'
);
SELECT
*
FROM
t1
WHERE
a
>=
'2010-02-01 09:31:02.0'
;
SELECT
*
FROM
t1
WHERE
'2010-02-01 09:31:02.0'
<=
a
;
SELECT
*
FROM
t1
WHERE
a
<=
'2010-02-01 09:31:02.0'
;
SELECT
*
FROM
t1
WHERE
'2010-02-01 09:31:02.0'
>=
a
;
--
replace_column
1
x
2
x
3
x
5
x
6
x
7
x
8
x
9
x
10
x
EXPLAIN
SELECT
*
FROM
t1
WHERE
a
>=
'2010-02-01 09:31:02.0'
;
SELECT
*
FROM
t1
WHERE
a
>=
'2010-02-01 09:31:02.0'
;
CREATE
TABLE
t2
(
a
TIMESTAMP
,
KEY
(
a
DESC
)
);
INSERT
INTO
t2
VALUES
(
'2010-02-01 09:31:01'
);
INSERT
INTO
t2
VALUES
(
'2010-02-01 09:31:02'
);
INSERT
INTO
t2
VALUES
(
'2010-02-01 09:31:03'
);
INSERT
INTO
t2
VALUES
(
'2010-02-01 09:31:04'
);
INSERT
INTO
t2
VALUES
(
'2010-02-01 09:31:05'
);
INSERT
INTO
t2
VALUES
(
'2010-02-01 09:31:06'
);
INSERT
INTO
t2
VALUES
(
'2010-02-01 09:31:07'
);
INSERT
INTO
t2
VALUES
(
'2010-02-01 09:31:08'
);
INSERT
INTO
t2
VALUES
(
'2010-02-01 09:31:09'
);
INSERT
INTO
t2
VALUES
(
'2010-02-01 09:31:10'
);
INSERT
INTO
t2
VALUES
(
'2010-02-01 09:31:11'
);
--
echo
# The bug would cause the range optimizer's comparison to use an open
--
echo
# interval here. This reveals itself only in the number of reads
--
echo
# performed.
FLUSH
STATUS
;
--
replace_column
1
x
2
x
3
x
5
x
6
x
7
x
8
x
9
x
10
x
EXPLAIN
SELECT
*
FROM
t2
WHERE
a
<
'2010-02-01 09:31:02.0'
;
SELECT
*
FROM
t2
WHERE
a
<
'2010-02-01 09:31:02.0'
;
SHOW
STATUS
LIKE
'Handler_read_next'
;
DROP
TABLE
t1
,
t2
;
--
echo
End
of
5.1
tests
--
echo
...
...
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