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
73bb79db
Commit
73bb79db
authored
Aug 06, 2003
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #792 combination of date-interval and between with mixed constant and non-constant
parent
3396c1a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
mysql-test/r/type_date.result
mysql-test/r/type_date.result
+2
-0
mysql-test/t/type_date.test
mysql-test/t/type_date.test
+1
-0
sql/item_timefunc.cc
sql/item_timefunc.cc
+4
-6
No files found.
mysql-test/r/type_date.result
View file @
73bb79db
...
...
@@ -32,6 +32,8 @@ datum
2000-01-02
2000-01-03
2000-01-04
SELECT * FROM t1 WHERE datum BETWEEN "2000-1-2" AND datum - INTERVAL 100 DAY;
datum
DROP TABLE t1;
CREATE TABLE t1 (
user_id char(10),
...
...
mysql-test/t/type_date.test
View file @
73bb79db
...
...
@@ -34,6 +34,7 @@ INSERT INTO t1 VALUES ( "2000-1-3" );
INSERT
INTO
t1
VALUES
(
"2000-1-4"
);
INSERT
INTO
t1
VALUES
(
"2000-1-5"
);
SELECT
*
FROM
t1
WHERE
datum
BETWEEN
"2000-1-2"
AND
"2000-1-4"
;
SELECT
*
FROM
t1
WHERE
datum
BETWEEN
"2000-1-2"
AND
datum
-
INTERVAL
100
DAY
;
DROP
TABLE
t1
;
#
...
...
sql/item_timefunc.cc
View file @
73bb79db
...
...
@@ -1058,14 +1058,12 @@ String *Item_date_add_interval::val_str(String *str)
longlong
Item_date_add_interval
::
val_int
()
{
TIME
ltime
;
longlong
date
;
if
(
Item_date_add_interval
::
get_date
(
&
ltime
,
0
))
return
(
longlong
)
0
;
return
((
longlong
)
(((
ulong
)
ltime
.
year
)
*
10000L
+
(((
uint
)
ltime
.
month
)
*
100
+
(
uint
)
ltime
.
day
))
*
(
longlong
)
1000000L
+
(
longlong
)
((
ulong
)
((
uint
)
ltime
.
hour
)
*
10000L
+
(
ulong
)
(((
uint
)
ltime
.
minute
)
*
100L
+
(
uint
)
ltime
.
second
)));
date
=
(
ltime
.
year
*
100L
+
ltime
.
month
)
*
100L
+
ltime
.
day
;
return
ltime
.
time_type
==
TIMESTAMP_DATE
?
date
:
((
date
*
100L
+
ltime
.
hour
)
*
100L
+
ltime
.
minute
)
*
100L
+
ltime
.
second
;
}
void
Item_extract
::
fix_length_and_dec
()
...
...
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