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
843d5b90
Commit
843d5b90
authored
Dec 19, 2003
by
pem@mysql.comhem.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Post-merge fixes.
parent
99e0ae85
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
62 deletions
+59
-62
mysql-test/r/func_time.result
mysql-test/r/func_time.result
+57
-57
sql/item_timefunc.cc
sql/item_timefunc.cc
+1
-4
sql/sql_parse.cc
sql/sql_parse.cc
+1
-1
No files found.
mysql-test/r/func_time.result
View file @
843d5b90
...
@@ -431,63 +431,6 @@ select * from t1, t3 where t1.start between t3.ctime1 and t3.ctime2;
...
@@ -431,63 +431,6 @@ select * from t1, t3 where t1.start between t3.ctime1 and t3.ctime2;
start ctime1 ctime2
start ctime1 ctime2
2002-11-04 00:00:00 2002-10-29 16:51:06 2002-11-05 16:47:31
2002-11-04 00:00:00 2002-10-29 16:51:06 2002-11-05 16:47:31
drop table t1,t2,t3;
drop table t1,t2,t3;
select date_add(date,INTERVAL "1" WEEK) from t1;
date_add(date,INTERVAL "1" WEEK)
2003-01-09 00:00:00
select date_add(date,INTERVAL "1" QUARTER) from t1;
date_add(date,INTERVAL "1" QUARTER)
2003-04-02
select timestampadd(MINUTE, 1, date) from t1;
timestampadd(MINUTE, 1, date)
2003-01-02 00:01:00
select timestampadd(WEEK, 1, date) from t1;
timestampadd(WEEK, 1, date)
2003-01-09 00:00:00
select timestampadd(SQL_TSI_SECOND, 1, date) from t1;
timestampadd(SQL_TSI_SECOND, 1, date)
2003-01-02 00:00:01
select timestampadd(SQL_TSI_FRAC_SECOND, 1, date) from t1;
timestampadd(SQL_TSI_FRAC_SECOND, 1, date)
2003-01-02 00:00:00.000001
select timestampdiff(MONTH, '2001-02-01', '2001-05-01') as a;
a
3
select timestampdiff(YEAR, '2002-05-01', '2001-01-01') as a;
a
-1
select timestampdiff(QUARTER, '2002-05-01', '2001-01-01') as a;
a
-5
select timestampdiff(MONTH, '2000-03-28', '2000-02-29') as a;
a
0
select timestampdiff(MONTH, '1991-03-28', '2000-02-29') as a;
a
107
select timestampdiff(SQL_TSI_WEEK, '2001-02-01', '2001-05-01') as a;
a
12
select timestampdiff(SQL_TSI_HOUR, '2001-02-01', '2001-05-01') as a;
a
2136
select timestampdiff(SQL_TSI_DAY, '2001-02-01', '2001-05-01') as a;
a
89
select timestampdiff(SQL_TSI_MINUTE, '2001-02-01 12:59:59', '2001-05-01 12:58:59') as a;
a
128159
select timestampdiff(SQL_TSI_SECOND, '2001-02-01 12:59:59', '2001-05-01 12:58:58') as a;
a
7689539
select timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12:58:58.119999') as a;
a
7689538999999
select timestampdiff(SQL_TSI_DAY, '1986-02-01', '1986-03-01') as a1,
timestampdiff(SQL_TSI_DAY, '1900-02-01', '1900-03-01') as a2,
timestampdiff(SQL_TSI_DAY, '1996-02-01', '1996-03-01') as a3,
timestampdiff(SQL_TSI_DAY, '2000-02-01', '2000-03-01') as a4;
a1 a2 a3 a4
28 28 29 29
select @a:=FROM_UNIXTIME(1);
select @a:=FROM_UNIXTIME(1);
@a:=FROM_UNIXTIME(1)
@a:=FROM_UNIXTIME(1)
1970-01-01 03:00:01
1970-01-01 03:00:01
...
@@ -553,6 +496,63 @@ date_add(date,INTERVAL "1 1:1" DAY_MINUTE)
...
@@ -553,6 +496,63 @@ date_add(date,INTERVAL "1 1:1" DAY_MINUTE)
select date_add(date,INTERVAL "1 1:1:1" DAY_SECOND) from t1;
select date_add(date,INTERVAL "1 1:1:1" DAY_SECOND) from t1;
date_add(date,INTERVAL "1 1:1:1" DAY_SECOND)
date_add(date,INTERVAL "1 1:1:1" DAY_SECOND)
2003-01-03 01:01:01
2003-01-03 01:01:01
select date_add(date,INTERVAL "1" WEEK) from t1;
date_add(date,INTERVAL "1" WEEK)
2003-01-09 00:00:00
select date_add(date,INTERVAL "1" QUARTER) from t1;
date_add(date,INTERVAL "1" QUARTER)
2003-04-02
select timestampadd(MINUTE, 1, date) from t1;
timestampadd(MINUTE, 1, date)
2003-01-02 00:01:00
select timestampadd(WEEK, 1, date) from t1;
timestampadd(WEEK, 1, date)
2003-01-09 00:00:00
select timestampadd(SQL_TSI_SECOND, 1, date) from t1;
timestampadd(SQL_TSI_SECOND, 1, date)
2003-01-02 00:00:01
select timestampadd(SQL_TSI_FRAC_SECOND, 1, date) from t1;
timestampadd(SQL_TSI_FRAC_SECOND, 1, date)
2003-01-02 00:00:00.000001
select timestampdiff(MONTH, '2001-02-01', '2001-05-01') as a;
a
3
select timestampdiff(YEAR, '2002-05-01', '2001-01-01') as a;
a
-1
select timestampdiff(QUARTER, '2002-05-01', '2001-01-01') as a;
a
-5
select timestampdiff(MONTH, '2000-03-28', '2000-02-29') as a;
a
0
select timestampdiff(MONTH, '1991-03-28', '2000-02-29') as a;
a
107
select timestampdiff(SQL_TSI_WEEK, '2001-02-01', '2001-05-01') as a;
a
12
select timestampdiff(SQL_TSI_HOUR, '2001-02-01', '2001-05-01') as a;
a
2136
select timestampdiff(SQL_TSI_DAY, '2001-02-01', '2001-05-01') as a;
a
89
select timestampdiff(SQL_TSI_MINUTE, '2001-02-01 12:59:59', '2001-05-01 12:58:59') as a;
a
128159
select timestampdiff(SQL_TSI_SECOND, '2001-02-01 12:59:59', '2001-05-01 12:58:58') as a;
a
7689539
select timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12:58:58.119999') as a;
a
7689538999999
select timestampdiff(SQL_TSI_DAY, '1986-02-01', '1986-03-01') as a1,
timestampdiff(SQL_TSI_DAY, '1900-02-01', '1900-03-01') as a2,
timestampdiff(SQL_TSI_DAY, '1996-02-01', '1996-03-01') as a3,
timestampdiff(SQL_TSI_DAY, '2000-02-01', '2000-03-01') as a4;
a1 a2 a3 a4
28 28 29 29
select date_add(time,INTERVAL 1 SECOND) from t1;
select date_add(time,INTERVAL 1 SECOND) from t1;
date_add(time,INTERVAL 1 SECOND)
date_add(time,INTERVAL 1 SECOND)
2006-07-08 00:00:01
2006-07-08 00:00:01
...
...
sql/item_timefunc.cc
View file @
843d5b90
...
@@ -1758,10 +1758,7 @@ longlong Item_extract::val_int()
...
@@ -1758,10 +1758,7 @@ longlong Item_extract::val_int()
case
INTERVAL_WEEK
:
case
INTERVAL_WEEK
:
{
{
week_format
=
current_thd
->
variables
.
default_week_format
;
week_format
=
current_thd
->
variables
.
default_week_format
;
return
calc_week
(
&
ltime
,
return
calc_week
(
&
ltime
,
week_mode
(
week_format
),
&
year
);
(
week_format
&
2
)
!=
0
,
(
week_format
&
1
)
==
0
,
&
year
);
}
}
case
INTERVAL_DAY
:
return
ltime
.
day
;
case
INTERVAL_DAY
:
return
ltime
.
day
;
case
INTERVAL_DAY_HOUR
:
return
(
long
)
(
ltime
.
day
*
100L
+
ltime
.
hour
)
*
neg
;
case
INTERVAL_DAY_HOUR
:
return
(
long
)
(
ltime
.
day
*
100L
+
ltime
.
hour
)
*
neg
;
...
...
sql/sql_parse.cc
View file @
843d5b90
...
@@ -2135,7 +2135,7 @@ mysql_execute_command(THD *thd)
...
@@ -2135,7 +2135,7 @@ mysql_execute_command(THD *thd)
create_table
->
next
=
0
;
create_table
->
next
=
0
;
if
(
&
lex
->
select_lex
!=
lex
->
all_selects_list
&&
if
(
&
lex
->
select_lex
!=
lex
->
all_selects_list
&&
lex
->
unit
.
create_total_list
(
thd
,
lex
,
&
tables
,
0
))
lex
->
unit
.
create_total_list
(
thd
,
lex
,
&
tables
,
0
))
DBUG_
VOID_RETURN
;
DBUG_
RETURN
(
-
1
)
;
ulong
want_priv
=
((
lex
->
create_info
.
options
&
HA_LEX_CREATE_TMP_TABLE
)
?
ulong
want_priv
=
((
lex
->
create_info
.
options
&
HA_LEX_CREATE_TMP_TABLE
)
?
CREATE_TMP_ACL
:
CREATE_ACL
);
CREATE_TMP_ACL
:
CREATE_ACL
);
...
...
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