Bug #33544: UDF_INIT member decimals initialized wrong with
STRING_RESULT argument There is a "magic" number for precision : NOT_FIXED_DEC. This means that the precision is not a fixed number. But this constant was re-defined in several files and was not available to the UDF developers. Moved the NOT_FIXED_DEC definition to the correct header and removed the redundant definitions.
This commit is contained in:
parent
48f9206576
commit
e8fd6cd4a1
@ -23,6 +23,7 @@
|
||||
#include <my_sys.h>
|
||||
#include <m_string.h>
|
||||
#include <m_ctype.h>
|
||||
#include <mysql_com.h>
|
||||
#ifdef HAVE_FCONVERT
|
||||
#include <floatingpoint.h>
|
||||
#endif
|
||||
|
@ -19,10 +19,6 @@
|
||||
#pragma interface /* gcc class implementation */
|
||||
#endif
|
||||
|
||||
#ifndef NOT_FIXED_DEC
|
||||
#define NOT_FIXED_DEC 31
|
||||
#endif
|
||||
|
||||
class String;
|
||||
int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
|
||||
String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
|
||||
|
@ -468,4 +468,5 @@ uchar *net_store_length(uchar *pkg, ulonglong length);
|
||||
#define MYSQL_STMT_HEADER 4
|
||||
#define MYSQL_LONG_DATA_HEADER 6
|
||||
|
||||
#define NOT_FIXED_DEC 31
|
||||
#endif
|
||||
|
@ -3794,10 +3794,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
|
||||
*/
|
||||
char buff[MAX_DOUBLE_STRING_REP_LENGTH];
|
||||
char *end;
|
||||
/* TODO: move this to a header shared between client and server. */
|
||||
#define NOT_FIXED_DEC 31
|
||||
if (field->decimals >= NOT_FIXED_DEC)
|
||||
#undef NOT_FIXED_DEC
|
||||
{
|
||||
/*
|
||||
The 14 below is to ensure that the server and client has the same
|
||||
|
@ -23,7 +23,6 @@
|
||||
#pragma interface /* gcc class implementation */
|
||||
#endif
|
||||
|
||||
#define NOT_FIXED_DEC 31
|
||||
#define DATETIME_DEC 6
|
||||
const uint32 max_field_size= (uint32) 4294967295U;
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <my_sys.h>
|
||||
#include <m_string.h>
|
||||
#include <m_ctype.h>
|
||||
#include <mysql_com.h>
|
||||
#ifdef HAVE_FCONVERT
|
||||
#include <floatingpoint.h>
|
||||
#endif
|
||||
|
@ -19,10 +19,6 @@
|
||||
#pragma interface /* gcc class implementation */
|
||||
#endif
|
||||
|
||||
#ifndef NOT_FIXED_DEC
|
||||
#define NOT_FIXED_DEC 31
|
||||
#endif
|
||||
|
||||
class String;
|
||||
int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
|
||||
String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
|
||||
|
@ -30,10 +30,6 @@
|
||||
|
||||
#define DECIMAL_MAX_LENGTH ((8 * 9) - 8)
|
||||
|
||||
#ifndef NOT_FIXED_DEC
|
||||
#define NOT_FIXED_DEC 31
|
||||
#endif
|
||||
|
||||
C_MODE_START
|
||||
extern int decimal_bin_size(int, int);
|
||||
C_MODE_END
|
||||
|
Loading…
x
Reference in New Issue
Block a user