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
7ddb8b68
Commit
7ddb8b68
authored
Nov 06, 2006
by
holyfoot/hf@mysql.com/deer.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug #19491 (5.0-related additional fixes)
parent
0d10dbe3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
9 deletions
+40
-9
include/my_time.h
include/my_time.h
+2
-0
mysql-test/r/gis-rtree.result
mysql-test/r/gis-rtree.result
+8
-7
sql-common/my_time.c
sql-common/my_time.c
+2
-2
sql/field.cc
sql/field.cc
+28
-0
No files found.
include/my_time.h
View file @
7ddb8b68
...
...
@@ -49,6 +49,8 @@ typedef long my_time_t;
#define TIME_NO_ZERO_DATE (TIME_NO_ZERO_IN_DATE*2)
#define TIME_INVALID_DATES (TIME_NO_ZERO_DATE*2)
my_bool
check_date
(
const
MYSQL_TIME
*
ltime
,
my_bool
not_zero_date
,
ulong
flags
,
int
*
was_cut
);
enum
enum_mysql_timestamp_type
str_to_datetime
(
const
char
*
str
,
uint
length
,
MYSQL_TIME
*
l_time
,
uint
flags
,
int
*
was_cut
);
...
...
mysql-test/r/gis-rtree.result
View file @
7ddb8b68
...
...
@@ -862,13 +862,6 @@ CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
CREATE TABLE t1(foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) );
INSERT INTO t1(foo) VALUES (NULL);
ERROR 23000: Column 'foo' cannot be null
INSERT INTO t1() VALUES ();
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
INSERT INTO t1(foo) VALUES ('');
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
CREATE TABLE t1 (foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) );
INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,1)));
INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,0)));
...
...
@@ -880,3 +873,11 @@ SELECT 1 FROM t1 WHERE foo != PointFromWKB(POINT(0,0));
1
1
DROP TABLE t1;
CREATE TABLE t1(foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) );
INSERT INTO t1(foo) VALUES (NULL);
ERROR 23000: Column 'foo' cannot be null
INSERT INTO t1() VALUES ();
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
INSERT INTO t1(foo) VALUES ('');
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
DROP TABLE t1;
sql-common/my_time.c
View file @
7ddb8b68
...
...
@@ -76,8 +76,8 @@ uint calc_days_in_year(uint year)
1 error
*/
static
my_bool
check_date
(
const
MYSQL_TIME
*
ltime
,
my_bool
not_zero_date
,
ulong
flags
,
int
*
was_cut
)
my_bool
check_date
(
const
MYSQL_TIME
*
ltime
,
my_bool
not_zero_date
,
ulong
flags
,
int
*
was_cut
)
{
if
(
not_zero_date
)
{
...
...
sql/field.cc
View file @
7ddb8b68
...
...
@@ -5407,7 +5407,21 @@ int Field_newdate::store_time(TIME *ltime,timestamp_type type)
long
tmp
;
int
error
=
0
;
if
(
type
==
MYSQL_TIMESTAMP_DATE
||
type
==
MYSQL_TIMESTAMP_DATETIME
)
{
tmp
=
ltime
->
year
*
16
*
32
+
ltime
->
month
*
32
+
ltime
->
day
;
if
((
my_bool
)
check_date
(
ltime
,
tmp
,
(
TIME_FUZZY_DATE
|
(
current_thd
->
variables
.
sql_mode
&
(
MODE_NO_ZERO_IN_DATE
|
MODE_NO_ZERO_DATE
|
MODE_INVALID_DATES
))),
&
error
))
{
char
buff
[
12
];
String
str
(
buff
,
sizeof
(
buff
),
&
my_charset_latin1
);
make_date
((
DATE_TIME_FORMAT
*
)
0
,
ltime
,
&
str
);
set_datetime_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
str
.
ptr
(),
str
.
length
(),
MYSQL_TIMESTAMP_DATE
,
1
);
}
}
else
{
tmp
=
0
;
...
...
@@ -5616,8 +5630,22 @@ int Field_datetime::store_time(TIME *ltime,timestamp_type type)
structure always fit into DATETIME range.
*/
if
(
type
==
MYSQL_TIMESTAMP_DATE
||
type
==
MYSQL_TIMESTAMP_DATETIME
)
{
tmp
=
((
ltime
->
year
*
10000L
+
ltime
->
month
*
100
+
ltime
->
day
)
*
LL
(
1000000
)
+
(
ltime
->
hour
*
10000L
+
ltime
->
minute
*
100
+
ltime
->
second
));
if
((
my_bool
)
check_date
(
ltime
,
tmp
,
(
TIME_FUZZY_DATE
|
(
current_thd
->
variables
.
sql_mode
&
(
MODE_NO_ZERO_IN_DATE
|
MODE_NO_ZERO_DATE
|
MODE_INVALID_DATES
))),
&
error
))
{
char
buff
[
12
];
String
str
(
buff
,
sizeof
(
buff
),
&
my_charset_latin1
);
make_datetime
((
DATE_TIME_FORMAT
*
)
0
,
ltime
,
&
str
);
set_datetime_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
str
.
ptr
(),
str
.
length
(),
MYSQL_TIMESTAMP_DATETIME
,
1
);
}
}
else
{
tmp
=
0
;
...
...
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