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
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
Show 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
...
@@ -32,6 +32,8 @@ datum
2000-01-02
2000-01-02
2000-01-03
2000-01-03
2000-01-04
2000-01-04
SELECT * FROM t1 WHERE datum BETWEEN "2000-1-2" AND datum - INTERVAL 100 DAY;
datum
DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (
CREATE TABLE t1 (
user_id char(10),
user_id char(10),
...
...
mysql-test/t/type_date.test
View file @
73bb79db
...
@@ -34,6 +34,7 @@ INSERT INTO t1 VALUES ( "2000-1-3" );
...
@@ -34,6 +34,7 @@ INSERT INTO t1 VALUES ( "2000-1-3" );
INSERT
INTO
t1
VALUES
(
"2000-1-4"
);
INSERT
INTO
t1
VALUES
(
"2000-1-4"
);
INSERT
INTO
t1
VALUES
(
"2000-1-5"
);
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
"2000-1-4"
;
SELECT
*
FROM
t1
WHERE
datum
BETWEEN
"2000-1-2"
AND
datum
-
INTERVAL
100
DAY
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
#
...
...
sql/item_timefunc.cc
View file @
73bb79db
...
@@ -1058,14 +1058,12 @@ String *Item_date_add_interval::val_str(String *str)
...
@@ -1058,14 +1058,12 @@ String *Item_date_add_interval::val_str(String *str)
longlong
Item_date_add_interval
::
val_int
()
longlong
Item_date_add_interval
::
val_int
()
{
{
TIME
ltime
;
TIME
ltime
;
longlong
date
;
if
(
Item_date_add_interval
::
get_date
(
&
ltime
,
0
))
if
(
Item_date_add_interval
::
get_date
(
&
ltime
,
0
))
return
(
longlong
)
0
;
return
(
longlong
)
0
;
return
((
longlong
)
(((
ulong
)
ltime
.
year
)
*
10000L
+
date
=
(
ltime
.
year
*
100L
+
ltime
.
month
)
*
100L
+
ltime
.
day
;
(((
uint
)
ltime
.
month
)
*
100
+
return
ltime
.
time_type
==
TIMESTAMP_DATE
?
date
:
(
uint
)
ltime
.
day
))
*
(
longlong
)
1000000L
+
((
date
*
100L
+
ltime
.
hour
)
*
100L
+
ltime
.
minute
)
*
100L
+
ltime
.
second
;
(
longlong
)
((
ulong
)
((
uint
)
ltime
.
hour
)
*
10000L
+
(
ulong
)
(((
uint
)
ltime
.
minute
)
*
100L
+
(
uint
)
ltime
.
second
)));
}
}
void
Item_extract
::
fix_length_and_dec
()
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