From 4f58bd7e94b86bc88215a68fd896fba5a2b5f909 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 May 2005 17:30:11 +0500 Subject: a fix (bug #10539: When inserting out of range value in BIT, different engines behaves differently). sql/field.cc: a fix (bug #10539: When inserting out of range value in BIT, different engines behaves differently). we have to set the first byte only if there is(are) uneven bit(s). --- sql/field.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sql') diff --git a/sql/field.cc b/sql/field.cc index 34c5210b43c..0b4445d45c2 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7821,7 +7821,7 @@ int Field_bit::store(const char *from, uint length, CHARSET_INFO *cs) int Field_bit::store(double nr) { - return (Field_bit::store((longlong) nr)); + return store((longlong) nr); } @@ -8004,7 +8004,8 @@ int Field_bit_as_char::store(const char *from, uint length, CHARSET_INFO *cs) (delta == 0 && bits && (uint) (uchar) *from >= (uint) (1 << bits))) { memset(ptr, 0xff, field_length); - *ptr&= ((1 << bits) - 1); /* set first byte */ + if (bits) + *ptr&= ((1 << bits) - 1); /* set first byte */ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); return 1; } -- cgit v1.2.1 From 44af4dbdf12f32ee5cb2be6d747c02b32912bf06 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Jun 2005 17:09:46 +0500 Subject: A fix (bug #10568: Function 'LAST_DAY(date)' does not return NULL for invalid argument). sql/item_timefunc.cc: A fix (bug #10568: Function 'LAST_DAY(date)' does not return NULL for invalid argument). Return error for partial dates as well. --- sql/item_timefunc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 3b6ca48fadd..16882e56d88 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -3015,7 +3015,7 @@ String *Item_func_str_to_date::val_str(String *str) bool Item_func_last_day::get_date(TIME *ltime, uint fuzzy_date) { - if (get_arg0_date(ltime,fuzzy_date)) + if (get_arg0_date(ltime, fuzzy_date & ~TIME_FUZZY_DATE)) return 1; uint month_idx= ltime->month-1; ltime->day= days_in_month[month_idx]; -- cgit v1.2.1 From 9a3bb0c74d0aec5212234c68eedd4da2b0d3ddf5 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 5 Jun 2005 16:20:22 +0200 Subject: sp_rcontext.cc, sp_pcontext.cc, sp_head.cc, sp_cache.cc, ha_federated.cc: Include "mysql_priv.h" before testing USE_PRAGMA_IMPLEMENTATION sql/ha_federated.cc: Include "mysql_priv.h" before testing USE_PRAGMA_IMPLEMENTATION sql/sp_cache.cc: Include "mysql_priv.h" before testing USE_PRAGMA_IMPLEMENTATION sql/sp_head.cc: Include "mysql_priv.h" before testing USE_PRAGMA_IMPLEMENTATION sql/sp_pcontext.cc: Include "mysql_priv.h" before testing USE_PRAGMA_IMPLEMENTATION sql/sp_rcontext.cc: Include "mysql_priv.h" before testing USE_PRAGMA_IMPLEMENTATION --- sql/ha_federated.cc | 5 ++--- sql/sp_cache.cc | 3 +-- sql/sp_head.cc | 3 +-- sql/sp_pcontext.cc | 2 +- sql/sp_rcontext.cc | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) (limited to 'sql') diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index c76034c7986..89210a2f3cd 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -345,12 +345,11 @@ */ -#ifdef __GNUC__ +#include "mysql_priv.h" +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" - #ifdef HAVE_FEDERATED_DB #include "ha_federated.h" #define MAX_REMOTE_SIZE IO_SIZE diff --git a/sql/sp_cache.cc b/sql/sp_cache.cc index 83811e76f9b..c8f0ed6ba2d 100644 --- a/sql/sp_cache.cc +++ b/sql/sp_cache.cc @@ -14,11 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation #endif - -#include "mysql_priv.h" #include "sp_cache.h" #include "sp_head.h" diff --git a/sql/sp_head.cc b/sql/sp_head.cc index c17c8b81cb2..84694d6b386 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -14,11 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation #endif - -#include "mysql_priv.h" #include "sp_head.h" #include "sp.h" #include "sp_pcontext.h" diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc index f95a43eb903..0de7fe212c0 100644 --- a/sql/sp_pcontext.cc +++ b/sql/sp_pcontext.cc @@ -14,6 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation #endif @@ -22,7 +23,6 @@ #undef SAFEMALLOC /* Problems with threads */ #endif -#include "mysql_priv.h" #include "sp_pcontext.h" #include "sp_head.h" diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc index 2e79a1e2533..0b5e7448d6c 100644 --- a/sql/sp_rcontext.cc +++ b/sql/sp_rcontext.cc @@ -14,6 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation #endif @@ -22,7 +23,6 @@ #undef SAFEMALLOC /* Problems with threads */ #endif -#include "mysql_priv.h" #include "mysql.h" #include "sp_head.h" #include "sp_rcontext.h" -- cgit v1.2.1 From 5888d0396ebeb958d4168df2481345242baa674e Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 5 Jun 2005 23:00:45 +0400 Subject: Fix broken linking when building with ha_federated --- sql/ha_federated.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/ha_federated.h b/sql/ha_federated.h index 22fc03e9eec..f084976718c 100644 --- a/sql/ha_federated.h +++ b/sql/ha_federated.h @@ -21,7 +21,7 @@ that you can implement. */ -#ifdef __GNUC__ +#ifdef USE_PRAGMA_INTERFACE #pragma interface /* gcc class implementation */ #endif -- cgit v1.2.1