mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
lp:737496 Assertion `(was_cut & 1) == 0' failed in Field_temporal::store_TIME_with_warning() in 5.1-micro
fix incorrect assert
This commit is contained in:
parent
c629477981
commit
e79a72a410
3 changed files with 17 additions and 3 deletions
|
@ -283,3 +283,8 @@ the_date the_time the_date the_time
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
DROP VIEW v1;
|
DROP VIEW v1;
|
||||||
End of 5.1 tests
|
End of 5.1 tests
|
||||||
|
create table t1 (f1 date, key (f1));
|
||||||
|
insert t1 values ('2010-10-10 15:foobar');
|
||||||
|
Warnings:
|
||||||
|
Warning 1265 Data truncated for column 'f1' at row 1
|
||||||
|
drop table t1;
|
||||||
|
|
|
@ -267,3 +267,11 @@ DROP TABLE t1;
|
||||||
DROP VIEW v1;
|
DROP VIEW v1;
|
||||||
|
|
||||||
--echo End of 5.1 tests
|
--echo End of 5.1 tests
|
||||||
|
|
||||||
|
#
|
||||||
|
# lp:737496 Field_temporal::store_TIME_with_warning() in 5.1-micro
|
||||||
|
#
|
||||||
|
create table t1 (f1 date, key (f1));
|
||||||
|
insert t1 values ('2010-10-10 15:foobar');
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
|
|
@ -5189,15 +5189,16 @@ int Field_temporal::store_TIME_with_warning(MYSQL_TIME *ltime,
|
||||||
was_cut= MYSQL_TIME_WARN_TRUNCATED;
|
was_cut= MYSQL_TIME_WARN_TRUNCATED;
|
||||||
ret= 1;
|
ret= 1;
|
||||||
}
|
}
|
||||||
else if (temporal_type() == MYSQL_TIMESTAMP_DATE &&
|
else if (!(was_cut & MYSQL_TIME_WARN_TRUNCATED) &&
|
||||||
|
temporal_type() == MYSQL_TIMESTAMP_DATE &&
|
||||||
(ltime->hour || ltime->minute || ltime->second || ltime->second_part))
|
(ltime->hour || ltime->minute || ltime->second || ltime->second_part))
|
||||||
{
|
{
|
||||||
DBUG_ASSERT((was_cut & MYSQL_TIME_WARN_TRUNCATED) == 0);
|
|
||||||
trunc_level= MYSQL_ERROR::WARN_LEVEL_NOTE;
|
trunc_level= MYSQL_ERROR::WARN_LEVEL_NOTE;
|
||||||
was_cut|= MYSQL_TIME_WARN_TRUNCATED;
|
was_cut|= MYSQL_TIME_WARN_TRUNCATED;
|
||||||
ret= 3;
|
ret= 3;
|
||||||
}
|
}
|
||||||
else if (temporal_type() == MYSQL_TIMESTAMP_TIME &&
|
else if (!(was_cut & MYSQL_TIME_WARN_TRUNCATED) &&
|
||||||
|
temporal_type() == MYSQL_TIMESTAMP_TIME &&
|
||||||
(ltime->year || ltime->month))
|
(ltime->year || ltime->month))
|
||||||
{
|
{
|
||||||
ltime->year= ltime->month= ltime->day= 0;
|
ltime->year= ltime->month= ltime->day= 0;
|
||||||
|
|
Loading…
Reference in a new issue