From: Date: November 1 2005 12:00pm Subject: bk commit into 4.1 tree (monty:1.2460) BUG#14009 List-Archive: http://lists.mysql.com/internals/31729 X-Bug: 14009 Message-Id: <20051101110009.CF9405858CF7@narttu.mysql.fi> Below is the list of changes that have just been committed into a local 4.1 repository of monty. When monty does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.2460 05/11/01 13:00:02 monty@stripped +6 -0 Review of new pushed code Removed wrong fix for bug #14009 (use of abs() on null value causes problems with filesort) Mark that add_time(), time_diff() and str_to_date() can return null values sql/spatial.cc 1.23 05/11/01 12:59:53 monty@stripped +22 -17 Simple cleanups during review of new code sql/item_timefunc.h 1.54 05/11/01 12:59:53 monty@stripped +1 -0 Mark that time_diff can return 0 sql/item_timefunc.cc 1.93 05/11/01 12:59:53 monty@stripped +3 -1 Mark that add_time and str_to_date() can return null values sql/item_func.cc 1.258 05/11/01 12:59:53 monty@stripped +0 -1 Removed wrong fix for bug #14009 (use of abs() on null value causes problems with filesort) mysql-test/r/func_sapdb.result 1.9 05/11/01 12:59:53 monty@stripped +2 -2 Fixed test after marking that timediff() can return NULL myisam/mi_check.c 1.156 05/11/01 12:59:53 monty@stripped +1 -1 keyoffset is not a position (no %lx here) # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: monty # Host: narttu.mysql.fi # Root: /home/my/mysql-4.1 --- 1.155/myisam/mi_check.c 2005-10-25 12:12:05 +03:00 +++ 1.156/myisam/mi_check.c 2005-11-01 12:59:53 +02:00 @@ -1839,7 +1839,7 @@ if (sort_one_index(param,info,keyinfo,next_page,new_file)) { DBUG_PRINT("error", - ("From page: %ld, keyoffset: 0x%lx used_length: %d", + ("From page: %ld, keyoffset: %lu used_length: %d", (ulong) pagepos, (ulong) (keypos - buff), (int) used_length)); DBUG_DUMP("buff",(byte*) buff,used_length); --- 1.257/sql/item_func.cc 2005-10-27 20:20:35 +03:00 +++ 1.258/sql/item_func.cc 2005-11-01 12:59:53 +02:00 @@ -766,7 +766,6 @@ hybrid_type= REAL_RESULT; if (args[0]->result_type() == INT_RESULT) hybrid_type= INT_RESULT; - maybe_null= 1; } --- 1.92/sql/item_timefunc.cc 2005-10-25 19:33:04 +03:00 +++ 1.93/sql/item_timefunc.cc 2005-11-01 12:59:53 +02:00 @@ -2381,6 +2381,7 @@ enum_field_types arg0_field_type; decimals=0; max_length=MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; + maybe_null= 1; /* The field type for the result of an Item_func_add_time function is defined @@ -2742,7 +2743,8 @@ void Item_func_str_to_date::fix_length_and_dec() { char format_buff[64]; - String format_str(format_buff, sizeof(format_buff), &my_charset_bin), *format; + String format_str(format_buff, sizeof(format_buff), &my_charset_bin); + String *format; maybe_null= 1; decimals=0; cached_field_type= MYSQL_TYPE_STRING; --- 1.53/sql/item_timefunc.h 2005-08-04 16:50:37 +03:00 +++ 1.54/sql/item_timefunc.h 2005-11-01 12:59:53 +02:00 @@ -808,6 +808,7 @@ { decimals=0; max_length=MAX_TIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; + maybe_null= 1; } Field *tmp_table_field(TABLE *t_arg) { --- 1.22/sql/spatial.cc 2005-10-31 10:00:57 +02:00 +++ 1.23/sql/spatial.cc 2005-11-01 12:59:53 +02:00 @@ -127,15 +127,14 @@ Geometry *result; char byte_order; - if (data_len < SRID_SIZE + 1 + 4) + if (data_len < SRID_SIZE + WKB_HEADER_SIZE) // < 4 + (1 + 4) return NULL; byte_order= data[SRID_SIZE]; geom_type= uint4korr(data + SRID_SIZE + 1); - data+= SRID_SIZE + WKB_HEADER_SIZE; if (!(result= create_by_typeid(buffer, (int) geom_type))) return NULL; - result->m_data= data; - result->m_data_end= data + (data_len - (SRID_SIZE + WKB_HEADER_SIZE)); + result->m_data= data+ SRID_SIZE + WKB_HEADER_SIZE; + result->m_data_end= data + data_len; return result; } @@ -737,7 +736,7 @@ wkb+= ls_len; } - return wkb - wkb_orig; + return (uint) (wkb - wkb_orig); } @@ -1182,7 +1181,8 @@ return 0; res->q_append(n_line_strings); - for (wkb+=4; n_line_strings; n_line_strings--) + wkb+= 4; + while (n_line_strings--) { Gis_line_string ls; int ls_len; @@ -1197,10 +1197,11 @@ if (!(ls_len= ls.init_from_wkb(wkb + WKB_HEADER_SIZE, len, (wkbByteOrder) wkb[0], res))) return 0; - wkb+= (ls_len + WKB_HEADER_SIZE); - len-= (ls_len + WKB_HEADER_SIZE); + ls_len+= WKB_HEADER_SIZE;; + wkb+= ls_len; + len-= ls_len; } - return wkb-wkb_orig; + return (uint) (wkb - wkb_orig); } @@ -1434,7 +1435,8 @@ return 0; res->q_append(n_poly); - for (wkb+=4; n_poly; n_poly--) + wkb+=4; + while (n_poly--) { Gis_polygon p; int p_len; @@ -1448,10 +1450,11 @@ if (!(p_len= p.init_from_wkb(wkb + WKB_HEADER_SIZE, len, (wkbByteOrder) wkb[0], res))) return 0; - wkb+= (p_len + WKB_HEADER_SIZE); - len-= (p_len + WKB_HEADER_SIZE); + p_len+= WKB_HEADER_SIZE; + wkb+= p_len; + len-= p_len; } - return wkb-wkb_orig; + return (uint) (wkb - wkb_orig); } @@ -1731,7 +1734,8 @@ return 0; res->q_append(n_geom); - for (wkb+=4; n_geom; n_geom--) + wkb+= 4; + while (n_geom--) { Geometry_buffer buffer; Geometry *geom; @@ -1750,10 +1754,11 @@ !(g_len= geom->init_from_wkb(wkb + WKB_HEADER_SIZE, len, (wkbByteOrder) wkb[0], res))) return 0; - wkb+= (g_len + WKB_HEADER_SIZE); - len-= (g_len + WKB_HEADER_SIZE); + g_len+= WKB_HEADER_SIZE; + wkb+= g_len; + len-= g_len; } - return wkb-wkb_orig; + return (uint) (wkb - wkb_orig); } --- 1.8/mysql-test/r/func_sapdb.result 2005-03-28 15:20:50 +03:00 +++ 1.9/mysql-test/r/func_sapdb.result 2005-11-01 12:59:53 +02:00 @@ -170,8 +170,8 @@ f1 date 0000-00-00 f2 datetime YES NULL f3 time YES NULL -f4 time 00:00:00 -f5 time 00:00:00 +f4 time YES NULL +f5 time YES NULL f6 time 00:00:00 f7 datetime YES NULL f8 date YES NULL