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
b509f2b3
Commit
b509f2b3
authored
Feb 04, 2005
by
jimw@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/jimw/my/mysql-4.1-6067
into mysql.com:/home/jimw/my/mysql-4.1-clean
parents
7a60d16f
891e8d07
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
2 deletions
+25
-2
mysql-test/r/type_date.result
mysql-test/r/type_date.result
+8
-0
mysql-test/t/type_date.test
mysql-test/t/type_date.test
+7
-0
sql/field.cc
sql/field.cc
+10
-2
No files found.
mysql-test/r/type_date.result
View file @
b509f2b3
...
@@ -96,3 +96,11 @@ f2
...
@@ -96,3 +96,11 @@ f2
19781126
19781126
19781126
19781126
DROP TABLE t1, t2, t3;
DROP TABLE t1, t2, t3;
CREATE TABLE t1 (y YEAR);
INSERT INTO t1 VALUES ('abc');
Warnings:
Warning 1265 Data truncated for column 'y' at row 1
SELECT * FROM t1;
y
0000
DROP TABLE t1;
mysql-test/t/type_date.test
View file @
b509f2b3
...
@@ -107,3 +107,10 @@ SELECT * FROM t2;
...
@@ -107,3 +107,10 @@ SELECT * FROM t2;
SELECT
*
FROM
t3
;
SELECT
*
FROM
t3
;
DROP
TABLE
t1
,
t2
,
t3
;
DROP
TABLE
t1
,
t2
,
t3
;
# Test that setting YEAR to invalid string results in default value, not
# 2000. (Bug #6067)
CREATE
TABLE
t1
(
y
YEAR
);
INSERT
INTO
t1
VALUES
(
'abc'
);
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
sql/field.cc
View file @
b509f2b3
...
@@ -3512,9 +3512,17 @@ void Field_time::sql_type(String &res) const
...
@@ -3512,9 +3512,17 @@ void Field_time::sql_type(String &res) const
int
Field_year
::
store
(
const
char
*
from
,
uint
len
,
CHARSET_INFO
*
cs
)
int
Field_year
::
store
(
const
char
*
from
,
uint
len
,
CHARSET_INFO
*
cs
)
{
{
int
not_used
;
// We can ignore result from str2int
int
err
;
char
*
end
;
char
*
end
;
long
nr
=
my_strntol
(
cs
,
from
,
len
,
10
,
&
end
,
&
not_used
);
long
nr
=
my_strntol
(
cs
,
from
,
len
,
10
,
&
end
,
&
err
);
if
(
err
)
{
if
(
table
->
in_use
->
count_cuted_fields
)
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_DATA_TRUNCATED
,
1
);
*
ptr
=
0
;
return
0
;
}
if
(
nr
<
0
||
nr
>=
100
&&
nr
<=
1900
||
nr
>
2155
)
if
(
nr
<
0
||
nr
>=
100
&&
nr
<=
1900
||
nr
>
2155
)
{
{
...
...
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