Commit 19eb2ce4 authored by unknown's avatar unknown

Field_geom should have same max_length as Field_blob

Updated tests
After merge fix


mysql-test/r/func_time.result:
  Updated tests
sql/field.cc:
  After merge fix
  Removed compiler warning
sql/field.h:
  Field_geom should have same max_length as Field_blob
parent 028dfdb3
...@@ -533,6 +533,8 @@ date_add(date,INTERVAL "1 1:1:1" DAY_SECOND) ...@@ -533,6 +533,8 @@ date_add(date,INTERVAL "1 1:1:1" DAY_SECOND)
select date_add(time,INTERVAL 1 SECOND) from t1; select date_add(time,INTERVAL 1 SECOND) from t1;
date_add(time,INTERVAL 1 SECOND) date_add(time,INTERVAL 1 SECOND)
NULL NULL
Warnings:
Warning 1264 Data truncated; out of range for column 'time' at row 1
drop table t1; drop table t1;
select last_day('2000-02-05') as f1, last_day('2002-12-31') as f2, select last_day('2000-02-05') as f1, last_day('2002-12-31') as f2,
last_day('2003-03-32') as f3, last_day('2003-04-01') as f4, last_day('2003-03-32') as f3, last_day('2003-04-01') as f4,
......
...@@ -3380,7 +3380,10 @@ bool Field_time::get_date(TIME *ltime, uint fuzzydate) ...@@ -3380,7 +3380,10 @@ bool Field_time::get_date(TIME *ltime, uint fuzzydate)
long tmp; long tmp;
if (!fuzzydate) if (!fuzzydate)
{ {
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); push_warning_printf(table->in_use, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_OUT_OF_RANGE,
ER(ER_WARN_DATA_OUT_OF_RANGE), field_name,
table->in_use->row_count);
return 1; return 1;
} }
tmp=(long) sint3korr(ptr); tmp=(long) sint3korr(ptr);
...@@ -5984,7 +5987,7 @@ uint32 Field_blob::max_length() ...@@ -5984,7 +5987,7 @@ uint32 Field_blob::max_length()
case 3: case 3:
return 16777215; return 16777215;
case 4: case 4:
return (uint32)4294967295; return (uint32) 4294967295U;
default: default:
DBUG_ASSERT(0); // we should never go here DBUG_ASSERT(0); // we should never go here
return 0; return 0;
......
...@@ -1089,7 +1089,6 @@ class Field_geom :public Field_blob { ...@@ -1089,7 +1089,6 @@ class Field_geom :public Field_blob {
void get_key_image(char *buff,uint length, CHARSET_INFO *cs,imagetype type); void get_key_image(char *buff,uint length, CHARSET_INFO *cs,imagetype type);
void set_key_image(char *buff,uint length, CHARSET_INFO *cs); void set_key_image(char *buff,uint length, CHARSET_INFO *cs);
uint32 max_length() { return field_length; }
field_cast_enum field_cast_type() { return FIELD_CAST_GEOM; } field_cast_enum field_cast_type() { return FIELD_CAST_GEOM; }
}; };
#endif /*HAVE_SPATIAL*/ #endif /*HAVE_SPATIAL*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment