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
77577014
Commit
77577014
authored
Jun 13, 2011
by
Mattias Jonsson
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
e827b51f
d53906e3
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1356 additions
and
0 deletions
+1356
-0
mysql-test/r/partition.result
mysql-test/r/partition.result
+18
-0
mysql-test/r/partition_datatype.result
mysql-test/r/partition_datatype.result
+1000
-0
mysql-test/t/partition.test
mysql-test/t/partition.test
+6
-0
mysql-test/t/partition_datatype.test
mysql-test/t/partition_datatype.test
+310
-0
sql/item_timefunc.cc
sql/item_timefunc.cc
+20
-0
sql/item_timefunc.h
sql/item_timefunc.h
+2
-0
No files found.
mysql-test/r/partition.result
View file @
77577014
...
...
@@ -218,6 +218,15 @@ a b
2007-07-30 17:35:48 p1
2009-07-14 17:35:55 pmax
2009-09-21 17:31:42 pmax
SELECT * FROM t1 where a between '2007-01-01' and '2007-08-01';
a b
2007-07-30 17:35:48 p1
EXPLAIN PARTITIONS SELECT * FROM t1 where a between '2007-01-01' and '2007-08-01';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1 system PRIMARY NULL NULL NULL 1
EXPLAIN PARTITIONS SELECT * FROM t1 where a = '2007-07-30 17:35:48';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1 system PRIMARY NULL NULL NULL 1
ALTER TABLE t1 REORGANIZE PARTITION pmax INTO (
PARTITION p3 VALUES LESS THAN (1247688000),
PARTITION pmax VALUES LESS THAN MAXVALUE);
...
...
@@ -226,6 +235,15 @@ a b
2007-07-30 17:35:48 p1
2009-07-14 17:35:55 pmax
2009-09-21 17:31:42 pmax
SELECT * FROM t1 where a between '2007-01-01' and '2007-08-01';
a b
2007-07-30 17:35:48 p1
EXPLAIN PARTITIONS SELECT * FROM t1 where a between '2007-01-01' and '2007-08-01';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1 system PRIMARY NULL NULL NULL 1
EXPLAIN PARTITIONS SELECT * FROM t1 where a = '2007-07-30 17:35:48';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1 system PRIMARY NULL NULL NULL 1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
...
...
mysql-test/r/partition_datatype.result
View file @
77577014
This diff is collapsed.
Click to expand it.
mysql-test/t/partition.test
View file @
77577014
...
...
@@ -227,10 +227,16 @@ INSERT INTO t1 VALUES ('2009-07-14 17:35:55', 'pmax');
INSERT
INTO
t1
VALUES
(
'2009-09-21 17:31:42'
,
'pmax'
);
SELECT
*
FROM
t1
;
SELECT
*
FROM
t1
where
a
between
'2007-01-01'
and
'2007-08-01'
;
EXPLAIN
PARTITIONS
SELECT
*
FROM
t1
where
a
between
'2007-01-01'
and
'2007-08-01'
;
EXPLAIN
PARTITIONS
SELECT
*
FROM
t1
where
a
=
'2007-07-30 17:35:48'
;
ALTER
TABLE
t1
REORGANIZE
PARTITION
pmax
INTO
(
PARTITION
p3
VALUES
LESS
THAN
(
1247688000
),
PARTITION
pmax
VALUES
LESS
THAN
MAXVALUE
);
SELECT
*
FROM
t1
;
SELECT
*
FROM
t1
where
a
between
'2007-01-01'
and
'2007-08-01'
;
EXPLAIN
PARTITIONS
SELECT
*
FROM
t1
where
a
between
'2007-01-01'
and
'2007-08-01'
;
EXPLAIN
PARTITIONS
SELECT
*
FROM
t1
where
a
=
'2007-07-30 17:35:48'
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
...
...
mysql-test/t/partition_datatype.test
View file @
77577014
This diff is collapsed.
Click to expand it.
sql/item_timefunc.cc
View file @
77577014
...
...
@@ -1388,6 +1388,26 @@ longlong Item_func_unix_timestamp::val_int()
return
(
longlong
)
TIME_to_timestamp
(
current_thd
,
&
ltime
,
&
not_used
);
}
enum_monotonicity_info
Item_func_unix_timestamp
::
get_monotonicity_info
()
const
{
if
(
args
[
0
]
->
type
()
==
Item
::
FIELD_ITEM
&&
(
args
[
0
]
->
field_type
()
==
MYSQL_TYPE_TIMESTAMP
))
return
MONOTONIC_INCREASING
;
return
NON_MONOTONIC
;
}
longlong
Item_func_unix_timestamp
::
val_int_endpoint
(
bool
left_endp
,
bool
*
incl_endp
)
{
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
arg_count
==
1
&&
args
[
0
]
->
type
()
==
Item
::
FIELD_ITEM
&&
args
[
0
]
->
field_type
()
==
MYSQL_TYPE_TIMESTAMP
);
Field
*
field
=
((
Item_field
*
)
args
[
0
])
->
field
;
/* Leave the incl_endp intact */
return
((
Field_timestamp
*
)
field
)
->
get_timestamp
(
&
null_value
);
}
longlong
Item_func_time_to_sec
::
val_int
()
{
...
...
sql/item_timefunc.h
View file @
77577014
...
...
@@ -391,6 +391,8 @@ class Item_func_unix_timestamp :public Item_int_func
Item_func_unix_timestamp
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"unix_timestamp"
;
}
enum_monotonicity_info
get_monotonicity_info
()
const
;
longlong
val_int_endpoint
(
bool
left_endp
,
bool
*
incl_endp
);
bool
check_partition_func_processor
(
uchar
*
int_arg
)
{
return
FALSE
;}
/*
UNIX_TIMESTAMP() depends on the current timezone
...
...
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