Loading include/my_global.h +6 −3 Original line number Diff line number Diff line Loading @@ -973,6 +973,7 @@ do { doubleget_union _tmp; \ #define float8get(V,M) doubleget((V),(M)) #define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float)) #define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V),sizeof(float)) #define floatget(V,M) memcpy((byte*) &V,(byte*) (M),sizeof(float)) #define float8store(V,M) doublestore((V),(M)) #endif /* __i386__ */ Loading Loading @@ -1143,6 +1144,7 @@ do { doubleget_union _tmp; \ *(((char*)T)+1)=(((A) >> 16));\ *(((char*)T)+0)=(((A) >> 24)); } while(0) #define floatget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(float)) #define floatstore(T,V) memcpy_fixed((byte*) (T),(byte*)(&V),sizeof(float)) #define doubleget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double)) #define doublestore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(double)) Loading @@ -1159,6 +1161,7 @@ do { doubleget_union _tmp; \ #define longstore(T,V) int4store(T,V) #ifndef floatstore #define floatstore(T,V) memcpy_fixed((byte*) (T),(byte*) (&V),sizeof(float)) #define floatget(V,M) memcpy_fixed((byte*) &V, (byte*) (M), sizeof(float)) #endif #ifndef doubleget #define doubleget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double)) Loading mysql-test/r/select.result +19 −0 Original line number Diff line number Diff line Loading @@ -2594,7 +2594,26 @@ INSERT INTO t1 SELECT 50, 3, 3 FROM DUAL WHERE NOT EXISTS (SELECT * FROM t1 WHERE a = 50 AND b = 3); select found_rows(); found_rows() 0 SELECT * FROM t1; a b c 50 3 3 select count(*) from t1; count(*) 1 select found_rows(); found_rows() 1 select count(*) from t1 limit 2,3; count(*) select found_rows(); found_rows() 0 select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; count(*) select found_rows(); found_rows() 1 DROP TABLE t1; mysql-test/t/select.test +7 −0 Original line number Diff line number Diff line Loading @@ -2153,6 +2153,13 @@ INSERT INTO t1 SELECT 50, 3, 3 FROM DUAL WHERE NOT EXISTS (SELECT * FROM t1 WHERE a = 50 AND b = 3); select found_rows(); SELECT * FROM t1; select count(*) from t1; select found_rows(); select count(*) from t1 limit 2,3; select found_rows(); select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; select found_rows(); DROP TABLE t1; sql/des_key_file.cc +0 −25 Original line number Diff line number Diff line Loading @@ -21,18 +21,6 @@ struct st_des_keyschedule des_keyschedule[10]; uint des_default_key; pthread_mutex_t LOCK_des_key_file; static int initialized= 0; void init_des_key_file() { if (!initialized) { initialized=1; pthread_mutex_init(&LOCK_des_key_file,MY_MUTEX_INIT_FAST); } } /* Function which loads DES keys from plaintext file into memory on MySQL Loading @@ -55,8 +43,6 @@ load_des_key_file(const char *file_name) DBUG_ENTER("load_des_key_file"); DBUG_PRINT("enter",("name: %s",file_name)); init_des_key_file(); VOID(pthread_mutex_lock(&LOCK_des_key_file)); if ((file=my_open(file_name,O_RDONLY | O_BINARY ,MYF(MY_WME))) < 0 || init_io_cache(&io, file, IO_SIZE*2, READ_CACHE, 0, 0, MYF(MY_WME))) Loading Loading @@ -113,15 +99,4 @@ load_des_key_file(const char *file_name) VOID(pthread_mutex_unlock(&LOCK_des_key_file)); DBUG_RETURN(result); } void free_des_key_file() { if (initialized) { initialized= 01; pthread_mutex_destroy(&LOCK_des_key_file); } } #endif /* HAVE_OPENSSL */ sql/field_conv.cc +31 −1 Original line number Diff line number Diff line Loading @@ -324,7 +324,34 @@ static void do_field_real(Copy_field *copy) } /* string copy for single byte characters set when to string is shorter than from string */ static void do_cut_string(Copy_field *copy) { CHARSET_INFO *cs= copy->from_field->charset(); memcpy(copy->to_ptr,copy->from_ptr,copy->to_length); /* Check if we loosed any important characters */ if (cs->cset->scan(cs, copy->from_ptr + copy->to_length, copy->from_ptr + copy->from_length, MY_SEQ_SPACES) < copy->from_length - copy->to_length) { copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); } } /* string copy for multi byte characters set when to string is shorter than from string */ static void do_cut_string_complex(Copy_field *copy) { // Shorter string field int well_formed_error; CHARSET_INFO *cs= copy->from_field->charset(); Loading @@ -351,6 +378,8 @@ static void do_cut_string(Copy_field *copy) } static void do_expand_string(Copy_field *copy) { CHARSET_INFO *cs= copy->from_field->charset(); Loading Loading @@ -517,7 +546,8 @@ void (*Copy_field::get_copy_func(Field *to,Field *from))(Copy_field*) from_length) return do_varstring; else if (to_length < from_length) return do_cut_string; return (from->charset()->mbmaxlen == 1 ? do_cut_string : do_cut_string_complex); else if (to_length > from_length) return do_expand_string; } Loading Loading
include/my_global.h +6 −3 Original line number Diff line number Diff line Loading @@ -973,6 +973,7 @@ do { doubleget_union _tmp; \ #define float8get(V,M) doubleget((V),(M)) #define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float)) #define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V),sizeof(float)) #define floatget(V,M) memcpy((byte*) &V,(byte*) (M),sizeof(float)) #define float8store(V,M) doublestore((V),(M)) #endif /* __i386__ */ Loading Loading @@ -1143,6 +1144,7 @@ do { doubleget_union _tmp; \ *(((char*)T)+1)=(((A) >> 16));\ *(((char*)T)+0)=(((A) >> 24)); } while(0) #define floatget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(float)) #define floatstore(T,V) memcpy_fixed((byte*) (T),(byte*)(&V),sizeof(float)) #define doubleget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double)) #define doublestore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(double)) Loading @@ -1159,6 +1161,7 @@ do { doubleget_union _tmp; \ #define longstore(T,V) int4store(T,V) #ifndef floatstore #define floatstore(T,V) memcpy_fixed((byte*) (T),(byte*) (&V),sizeof(float)) #define floatget(V,M) memcpy_fixed((byte*) &V, (byte*) (M), sizeof(float)) #endif #ifndef doubleget #define doubleget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double)) Loading
mysql-test/r/select.result +19 −0 Original line number Diff line number Diff line Loading @@ -2594,7 +2594,26 @@ INSERT INTO t1 SELECT 50, 3, 3 FROM DUAL WHERE NOT EXISTS (SELECT * FROM t1 WHERE a = 50 AND b = 3); select found_rows(); found_rows() 0 SELECT * FROM t1; a b c 50 3 3 select count(*) from t1; count(*) 1 select found_rows(); found_rows() 1 select count(*) from t1 limit 2,3; count(*) select found_rows(); found_rows() 0 select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; count(*) select found_rows(); found_rows() 1 DROP TABLE t1;
mysql-test/t/select.test +7 −0 Original line number Diff line number Diff line Loading @@ -2153,6 +2153,13 @@ INSERT INTO t1 SELECT 50, 3, 3 FROM DUAL WHERE NOT EXISTS (SELECT * FROM t1 WHERE a = 50 AND b = 3); select found_rows(); SELECT * FROM t1; select count(*) from t1; select found_rows(); select count(*) from t1 limit 2,3; select found_rows(); select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; select found_rows(); DROP TABLE t1;
sql/des_key_file.cc +0 −25 Original line number Diff line number Diff line Loading @@ -21,18 +21,6 @@ struct st_des_keyschedule des_keyschedule[10]; uint des_default_key; pthread_mutex_t LOCK_des_key_file; static int initialized= 0; void init_des_key_file() { if (!initialized) { initialized=1; pthread_mutex_init(&LOCK_des_key_file,MY_MUTEX_INIT_FAST); } } /* Function which loads DES keys from plaintext file into memory on MySQL Loading @@ -55,8 +43,6 @@ load_des_key_file(const char *file_name) DBUG_ENTER("load_des_key_file"); DBUG_PRINT("enter",("name: %s",file_name)); init_des_key_file(); VOID(pthread_mutex_lock(&LOCK_des_key_file)); if ((file=my_open(file_name,O_RDONLY | O_BINARY ,MYF(MY_WME))) < 0 || init_io_cache(&io, file, IO_SIZE*2, READ_CACHE, 0, 0, MYF(MY_WME))) Loading Loading @@ -113,15 +99,4 @@ load_des_key_file(const char *file_name) VOID(pthread_mutex_unlock(&LOCK_des_key_file)); DBUG_RETURN(result); } void free_des_key_file() { if (initialized) { initialized= 01; pthread_mutex_destroy(&LOCK_des_key_file); } } #endif /* HAVE_OPENSSL */
sql/field_conv.cc +31 −1 Original line number Diff line number Diff line Loading @@ -324,7 +324,34 @@ static void do_field_real(Copy_field *copy) } /* string copy for single byte characters set when to string is shorter than from string */ static void do_cut_string(Copy_field *copy) { CHARSET_INFO *cs= copy->from_field->charset(); memcpy(copy->to_ptr,copy->from_ptr,copy->to_length); /* Check if we loosed any important characters */ if (cs->cset->scan(cs, copy->from_ptr + copy->to_length, copy->from_ptr + copy->from_length, MY_SEQ_SPACES) < copy->from_length - copy->to_length) { copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); } } /* string copy for multi byte characters set when to string is shorter than from string */ static void do_cut_string_complex(Copy_field *copy) { // Shorter string field int well_formed_error; CHARSET_INFO *cs= copy->from_field->charset(); Loading @@ -351,6 +378,8 @@ static void do_cut_string(Copy_field *copy) } static void do_expand_string(Copy_field *copy) { CHARSET_INFO *cs= copy->from_field->charset(); Loading Loading @@ -517,7 +546,8 @@ void (*Copy_field::get_copy_func(Field *to,Field *from))(Copy_field*) from_length) return do_varstring; else if (to_length < from_length) return do_cut_string; return (from->charset()->mbmaxlen == 1 ? do_cut_string : do_cut_string_complex); else if (to_length > from_length) return do_expand_string; } Loading