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
c0cb3afb
Commit
c0cb3afb
authored
20 years ago
by
ram@gw.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A fix (bug #2335: Inconsistancy with handling of Years and NOW() function).
The test might fail if one runs it at 23:59:59 Dec 31
parent
8178bd4e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
mysql-test/r/type_year.result
mysql-test/r/type_year.result
+6
-0
mysql-test/t/type_year.test
mysql-test/t/type_year.test
+9
-0
sql/field.h
sql/field.h
+1
-0
No files found.
mysql-test/r/type_year.result
View file @
c0cb3afb
...
@@ -26,3 +26,9 @@ y y2
...
@@ -26,3 +26,9 @@ y y2
2001 01
2001 01
2069 69
2069 69
drop table t1;
drop table t1;
create table t1 (y year);
insert into t1 values (now());
select if(y = now(), 1, 0) from t1;
if(y = now(), 1, 0)
1
drop table t1;
This diff is collapsed.
Click to expand it.
mysql-test/t/type_year.test
View file @
c0cb3afb
...
@@ -8,3 +8,12 @@ select * from t1;
...
@@ -8,3 +8,12 @@ select * from t1;
select
*
from
t1
order
by
y
;
select
*
from
t1
order
by
y
;
select
*
from
t1
order
by
y2
;
select
*
from
t1
order
by
y2
;
drop
table
t1
;
drop
table
t1
;
#
# Bug 2335
#
create
table
t1
(
y
year
);
insert
into
t1
values
(
now
());
select
if
(
y
=
now
(),
1
,
0
)
from
t1
;
drop
table
t1
;
This diff is collapsed.
Click to expand it.
sql/field.h
View file @
c0cb3afb
...
@@ -600,6 +600,7 @@ public:
...
@@ -600,6 +600,7 @@ public:
longlong
val_int
(
void
);
longlong
val_int
(
void
);
String
*
val_str
(
String
*
,
String
*
);
String
*
val_str
(
String
*
,
String
*
);
void
sql_type
(
String
&
str
)
const
;
void
sql_type
(
String
&
str
)
const
;
bool
store_for_compare
()
{
return
1
;
}
};
};
...
...
This diff is collapsed.
Click to expand it.
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