#At file:///data/z/mysql-next-mr-runtime/ based on revid:magne.mahre@stripped
2931 Magne Mahre 2009-11-11 [merge]
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.
Backported to 5.6.0 (mysql-next-mr-runtime)
@ client/sql_string.h
moved NOT_FIXED_DEC to the correct header
@ include/mysql_com.h
moved NOT_FIXED_DEC to the correct header
@ libmysql/libmysql.c
moved NOT_FIXED_DEC to the correct header
@ sql/field.h
moved NOT_FIXED_DEC to the correct header
@ sql/sql_string.h
moved NOT_FIXED_DEC to the correct header
@ storage/ndb/include/kernel/signaldata/DictTabInfo.hpp
moved NOT_FIXED_DEC to the correct header
modified:
client/sql_string.cc
client/sql_string.h
include/mysql_com.h
libmysql/libmysql.c
sql/field.h
sql/sql_string.cc
sql/sql_string.h
storage/ndb/include/kernel/signaldata/DictTabInfo.hpp
=== modified file 'client/sql_string.cc'
--- a/client/sql_string.cc 2009-03-24 13:58:52 +0000
+++ b/client/sql_string.cc 2009-11-11 20:19:41 +0000
@@ -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
=== modified file 'client/sql_string.h'
--- a/client/sql_string.h 2009-09-23 21:32:31 +0000
+++ b/client/sql_string.h 2009-11-11 20:19:41 +0000
@@ -22,10 +22,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);
=== modified file 'include/mysql_com.h'
--- a/include/mysql_com.h 2009-11-02 11:10:04 +0000
+++ b/include/mysql_com.h 2009-11-11 20:19:41 +0000
@@ -524,4 +524,5 @@ uchar *net_store_length(uchar *pkg, ulon
#define MYSQL_STMT_HEADER 4
#define MYSQL_LONG_DATA_HEADER 6
+#define NOT_FIXED_DEC 31
#endif
=== modified file 'libmysql/libmysql.c'
--- a/libmysql/libmysql.c 2009-10-21 20:02:06 +0000
+++ b/libmysql/libmysql.c 2009-11-11 20:19:41 +0000
@@ -3464,10 +3464,7 @@ static void fetch_float_with_conversion(
*/
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
{
/*
DBL_DIG below is to ensure that the server and client has the same
=== modified file 'sql/field.h'
--- a/sql/field.h 2009-11-10 20:51:14 +0000
+++ b/sql/field.h 2009-11-11 20:19:41 +0000
@@ -25,7 +25,6 @@
#pragma interface /* gcc class implementation */
#endif
-#define NOT_FIXED_DEC 31
#define DATETIME_DEC 6
const uint32 max_field_size= (uint32) 4294967295U;
=== modified file 'sql/sql_string.cc'
--- a/sql/sql_string.cc 2009-11-10 20:51:14 +0000
+++ b/sql/sql_string.cc 2009-11-11 20:19:41 +0000
@@ -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
=== modified file 'sql/sql_string.h'
--- a/sql/sql_string.h 2009-10-28 07:55:44 +0000
+++ b/sql/sql_string.h 2009-11-11 20:19:41 +0000
@@ -22,10 +22,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);
=== modified file 'storage/ndb/include/kernel/signaldata/DictTabInfo.hpp'
--- a/storage/ndb/include/kernel/signaldata/DictTabInfo.hpp 2007-04-26 11:50:04 +0000
+++ b/storage/ndb/include/kernel/signaldata/DictTabInfo.hpp 2008-03-05 14:27:35 +0000
@@ -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
Attachment: [text/bzr-bundle] bzr/magne.mahre@sun.com-20091111201941-agof2k0tayptnng2.bundle
| Thread |
|---|
| • bzr commit into mysql-5.5-next-mr-runtime branch (magne.mahre:2931)Bug#33544 | Magne Mahre | 11 Nov |