From 6c993233d9861534d93a2468dbc7a702187a5633 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2004 13:07:38 +0100 Subject: [PATCH 1/3] fix problem with make dist and decimal.h include/Makefile.am: fix the problem with make dist - decimal.h needs to be in the source distribution --- include/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Makefile.am b/include/Makefile.am index 0c845900a4f..cbb8e1ead53 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -30,7 +30,7 @@ noinst_HEADERS = config-win.h config-os2.h config-netware.h \ my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \ my_aes.h my_tree.h hash.h thr_alarm.h \ thr_lock.h t_ctype.h violite.h md5.h \ - mysql_version.h.in my_handler.h my_time.h + mysql_version.h.in my_handler.h my_time.h decimal.h # mysql_version.h are generated SUPERCLEANFILES = mysql_version.h my_config.h From ed5fed3c8be8f4ec209c42dc057d417094c4e2eb Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2004 12:26:49 +0000 Subject: [PATCH 2/3] correct ndb version upgrade compatability with 4.1.8 configure.in: correct ndb version ndb/src/common/util/version.c: upgrade compatability with 4.1.8 --- configure.in | 9 +++++---- ndb/src/common/util/version.c | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 8b5104cdb42..754494f7d70 100644 --- a/configure.in +++ b/configure.in @@ -4,6 +4,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! +# remember to also change ndb version below and update version.c in ndb AM_INIT_AUTOMAKE(mysql, 5.0.2-alpha) AM_CONFIG_HEADER(config.h) @@ -13,10 +14,10 @@ DOT_FRM_VERSION=6 SHARED_LIB_VERSION=14:0:0 # ndb version -NDB_VERSION_MAJOR=3 -NDB_VERSION_MINOR=5 -NDB_VERSION_BUILD=3 -NDB_VERSION_STATUS="" +NDB_VERSION_MAJOR=5 +NDB_VERSION_MINOR=0 +NDB_VERSION_BUILD=2 +NDB_VERSION_STATUS="alpha" # Set all version vars based on $VERSION. How do we do this more elegant ? # Remember that regexps needs to quote [ and ] since this is run through m4 diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c index e2515b243b1..965d0a735e1 100644 --- a/ndb/src/common/util/version.c +++ b/ndb/src/common/util/version.c @@ -70,10 +70,13 @@ struct NdbUpGradeCompatible { #ifndef TEST_VERSION struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { { MAKE_VERSION(3,5,2), MAKE_VERSION(3,5,1), UG_Exact }, + { MAKE_VERSION(4,1,8), MAKE_VERSION(3,5,4), UG_Exact }, /* Aligned version with MySQL */ { 0, 0, UG_Null } }; struct NdbUpGradeCompatible ndbCompatibleTable_upgrade[] = { + { MAKE_VERSION(5,0,2), MAKE_VERSION(4,1,8), UG_Exact }, + { MAKE_VERSION(3,5,4), MAKE_VERSION(3,5,3), UG_Exact }, { 0, 0, UG_Null } }; From 2a4e8ff7bece1e4faddb3a5d378f5acdbfa44481 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2004 13:27:44 +0100 Subject: [PATCH 3/3] space-stripping in decimal2bin --- strings/decimal.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/strings/decimal.c b/strings/decimal.c index 821fc1414ad..c34f570eec3 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -579,18 +579,44 @@ int decimal2bin(decimal *from, char *to, int precision, int frac) { dec1 mask=from->sign ? -1 : 0, *buf1=from->buf, *stop1; int error=E_DEC_OK, intg=precision-frac, + isize1, intg1, intg1x=from->intg, intg0=intg/DIG_PER_DEC1, frac0=frac/DIG_PER_DEC1, intg0x=intg-intg0*DIG_PER_DEC1, frac0x=frac-frac0*DIG_PER_DEC1, - intg1=from->intg/DIG_PER_DEC1, frac1=from->frac/DIG_PER_DEC1, - intg1x=from->intg-intg1*DIG_PER_DEC1, frac1x=from->frac-frac1*DIG_PER_DEC1, isize0=intg0*sizeof(dec1)+dig2bytes[intg0x], fsize0=frac0*sizeof(dec1)+dig2bytes[frac0x], - isize1=intg1*sizeof(dec1)+dig2bytes[intg1x], fsize1=frac1*sizeof(dec1)+dig2bytes[frac1x]; + + /* removing leading zeroes */ + intg1=((intg1x-1) % DIG_PER_DEC1)+1; + while (intg1x > 0 && *buf1 == 0) + { + intg1x-=intg1; + intg1=DIG_PER_DEC1; + buf1++; + } + if (intg1x > 0) + { + for (intg1=(intg1x-1) % DIG_PER_DEC1; *buf1 < powers10[intg1--]; intg1x--) ; + DBUG_ASSERT(intg1x > 0); + } + else + intg1x=0; + + if (unlikely(intg1x+fsize1==0)) + { + mask=0; /* just in case */ + intg=1; + buf1=&mask; + } + + intg1=intg1x/DIG_PER_DEC1; + intg1x=intg1x-intg1*DIG_PER_DEC1; + isize1=intg1*sizeof(dec1)+dig2bytes[intg1x]; + if (isize0 < isize1) { buf1+=intg1-intg0+(intg1x>0)-(intg0x>0);