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
e38221a4
Commit
e38221a4
authored
Jun 12, 2003
by
lenz@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/space/my/mysql-4.0
into mysql.com:/space/my/mysql-4.0-build
parents
2daa5643
db088dc4
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
0 deletions
+23
-0
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
mysql-test/r/func_time.result
mysql-test/r/func_time.result
+3
-0
mysql-test/t/func_time.test
mysql-test/t/func_time.test
+2
-0
sql/item_timefunc.cc
sql/item_timefunc.cc
+16
-0
sql/item_timefunc.h
sql/item_timefunc.h
+1
-0
No files found.
BitKeeper/etc/logging_ok
View file @
e38221a4
...
@@ -24,6 +24,7 @@ heikki@donna.mysql.fi
...
@@ -24,6 +24,7 @@ heikki@donna.mysql.fi
heikki@hundin.mysql.fi
heikki@hundin.mysql.fi
heikki@rescue.
heikki@rescue.
heikki@work.mysql.com
heikki@work.mysql.com
hf@deer.(none)
hf@deer.mysql.r18.ru
hf@deer.mysql.r18.ru
hf@genie.(none)
hf@genie.(none)
igor@hundin.mysql.fi
igor@hundin.mysql.fi
...
...
mysql-test/r/func_time.result
View file @
e38221a4
...
@@ -329,6 +329,9 @@ insert into t1 values ('2001-01-12 12:23:40');
...
@@ -329,6 +329,9 @@ insert into t1 values ('2001-01-12 12:23:40');
select ctime, hour(ctime) from t1;
select ctime, hour(ctime) from t1;
ctime hour(ctime)
ctime hour(ctime)
2001-01-12 12:23:40 12
2001-01-12 12:23:40 12
select ctime from t1 where extract(MONTH FROM ctime) = 1 AND extract(YEAR FROM ctime) = 2001;
ctime
2001-01-12 12:23:40
drop table t1;
drop table t1;
create table t1 (id int);
create table t1 (id int);
create table t2 (id int, date date);
create table t2 (id int, date date);
...
...
mysql-test/t/func_time.test
View file @
e38221a4
...
@@ -123,6 +123,8 @@ select extract(MONTH FROM "2001-02-00");
...
@@ -123,6 +123,8 @@ select extract(MONTH FROM "2001-02-00");
create
table
t1
(
ctime
varchar
(
20
));
create
table
t1
(
ctime
varchar
(
20
));
insert
into
t1
values
(
'2001-01-12 12:23:40'
);
insert
into
t1
values
(
'2001-01-12 12:23:40'
);
select
ctime
,
hour
(
ctime
)
from
t1
;
select
ctime
,
hour
(
ctime
)
from
t1
;
# test bug 614 (multiple extracts in where)
select
ctime
from
t1
where
extract
(
MONTH
FROM
ctime
)
=
1
AND
extract
(
YEAR
FROM
ctime
)
=
2001
;
drop
table
t1
;
drop
table
t1
;
#
#
...
...
sql/item_timefunc.cc
View file @
e38221a4
...
@@ -1137,6 +1137,22 @@ longlong Item_extract::val_int()
...
@@ -1137,6 +1137,22 @@ longlong Item_extract::val_int()
return
0
;
// Impossible
return
0
;
// Impossible
}
}
bool
Item_extract
::
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
{
if
(
this
==
item
)
return
1
;
if
(
item
->
type
()
!=
FUNC_ITEM
||
func_name
()
!=
((
Item_func
*
)
item
)
->
func_name
())
return
0
;
Item_extract
*
ie
=
(
Item_extract
*
)
item
;
if
(
ie
->
int_type
!=
int_type
)
return
0
;
if
(
!
args
[
0
]
->
eq
(
ie
->
args
[
0
],
binary_cmp
))
return
0
;
return
1
;
}
void
Item_typecast
::
print
(
String
*
str
)
void
Item_typecast
::
print
(
String
*
str
)
{
{
...
...
sql/item_timefunc.h
View file @
e38221a4
...
@@ -422,6 +422,7 @@ class Item_extract :public Item_int_func
...
@@ -422,6 +422,7 @@ class Item_extract :public Item_int_func
longlong
val_int
();
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"extract"
;
}
const
char
*
func_name
()
const
{
return
"extract"
;
}
void
fix_length_and_dec
();
void
fix_length_and_dec
();
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
;
unsigned
int
size_of
()
{
return
sizeof
(
*
this
);}
unsigned
int
size_of
()
{
return
sizeof
(
*
this
);}
};
};
...
...
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