Commit 96c3bd94 authored by unknown's avatar unknown

moved bdb/innobase to compile-pentium-debug-max

fixed bug in variable assignment in mysqltest
fixed coredump on conversion from empty blob/text to date
added test case for empty blob conversion to date


BUILD/compile-pentium-debug:
  move bdb/innobase to compile-pentium-debug-max
client/mysqltest.c:
  fixed bug in variable assignment
sql/time.cc:
  fixed coredump on conversion from empty blob/text to date
parent 3b91fce6
...@@ -8,6 +8,6 @@ c_warnings="$c_warnings $debug_extra_warnings" ...@@ -8,6 +8,6 @@ c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings" cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs" extra_configs="$pentium_configs $debug_configs"
extra_configs="$extra_configs --with-berkeley-db --with-innobase" extra_configs="$extra_configs "
. "$path/FINISH.sh" . "$path/FINISH.sh"
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
extra_configs="$extra_configs --with-berkeley-db --with-innobase"
. "$path/FINISH.sh"
...@@ -241,8 +241,8 @@ static void do_eval(DYNAMIC_STRING* query_eval, const char* query) ...@@ -241,8 +241,8 @@ static void do_eval(DYNAMIC_STRING* query_eval, const char* query)
else else
{ {
if(!(v = var_get(p, &p, 0))) if(!(v = var_get(p, &p, 0)))
die("Bad variabled in eval"); die("Bad variable in eval");
dynstr_append(query_eval, v->str_val); dynstr_append_mem(query_eval, v->str_val, v->str_val_len);
} }
break; break;
case '\\': case '\\':
...@@ -436,6 +436,7 @@ VAR* var_get(const char* var_name, const char** var_name_end, int raw) ...@@ -436,6 +436,7 @@ VAR* var_get(const char* var_name, const char** var_name_end, int raw)
{ {
sprintf(v->str_val, "%d", v->int_val); sprintf(v->str_val, "%d", v->int_val);
v->int_dirty = 0; v->int_dirty = 0;
v->str_val_len = strlen(v->str_val);
} }
if(var_name_end) if(var_name_end)
*var_name_end = var_name ; *var_name_end = var_name ;
...@@ -475,7 +476,7 @@ int var_set(char* var_name, char* var_name_end, char* var_val, ...@@ -475,7 +476,7 @@ int var_set(char* var_name, char* var_name_end, char* var_val,
die("Out of memory"); die("Out of memory");
} }
memcpy(v->str_val, var_val, val_len-1); memcpy(v->str_val, var_val, val_len-1);
v->str_val_len = val_len; v->str_val_len = val_len - 1;
v->str_val[val_len] = 0; v->str_val[val_len] = 0;
v->int_val = atoi(v->str_val); v->int_val = atoi(v->str_val);
return 0; return 0;
......
month(updated)
10
NULL
year(updated)
1999
NULL
drop table if exists db_crash;
CREATE TABLE df_crash (
updated text
) TYPE=MyISAM;
INSERT INTO df_crash VALUES ('1999-10-5');
insert into df_crash values ('');
select month(updated) from df_crash;
select year(updated) from df_crash;
drop table df_crash;
...@@ -428,11 +428,15 @@ str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date) ...@@ -428,11 +428,15 @@ str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date)
uint field_length,year_length,digits,i,number_of_fields,date[7]; uint field_length,year_length,digits,i,number_of_fields,date[7];
bool date_used=0; bool date_used=0;
const char *pos; const char *pos;
const char *end=str+length;
DBUG_ENTER("str_to_TIME"); DBUG_ENTER("str_to_TIME");
DBUG_PRINT("enter",("str: %.*s",length,str)); DBUG_PRINT("enter",("str: %.*s",length,str));
for (; !isdigit(*str) && str != end ; str++) ; // Skipp garbage if(!str)
DBUG_RETURN(TIMESTAMP_NONE);
const char *end=str+length;
for (; !isdigit(*str) && str != end ; str++) ; // Skip garbage
if (str == end) if (str == end)
DBUG_RETURN(TIMESTAMP_NONE); DBUG_RETURN(TIMESTAMP_NONE);
/* /*
......
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