summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2012-01-13 15:50:02 +0100
committerSergei Golubchik <sergii@pisem.net>2012-01-13 15:50:02 +0100
commit4f435bddfd44d40999f88685c61cc04e319d8d6c (patch)
treef9d0655a0d901b87f918a736741144b502cba3f6 /strings
parent8c2bcdf85ff753bceeb5b235f3605e348e6f9e1d (diff)
parent6ca4ca7d37fed3b3da18666768de6a2f8c34bc7b (diff)
downloadmariadb-git-4f435bddfd44d40999f88685c61cc04e319d8d6c.tar.gz
5.3 merge
Diffstat (limited to 'strings')
-rw-r--r--strings/CMakeLists.txt2
-rw-r--r--strings/conf_to_src.c1
-rw-r--r--strings/ctype-big5.c2
-rw-r--r--strings/ctype-bin.c3
-rw-r--r--strings/ctype-cp932.c2
-rw-r--r--strings/ctype-czech.c3
-rw-r--r--strings/ctype-euc_kr.c2
-rw-r--r--strings/ctype-extra.c3
-rw-r--r--strings/ctype-gb2312.c2
-rw-r--r--strings/ctype-gbk.c2
-rw-r--r--strings/ctype-latin1.c2
-rw-r--r--strings/ctype-mb.c2
-rw-r--r--strings/ctype-simple.c3
-rw-r--r--strings/ctype-sjis.c2
-rw-r--r--strings/ctype-tis620.c17
-rw-r--r--strings/ctype-uca.c3
-rw-r--r--strings/ctype-ucs2.c2
-rw-r--r--strings/ctype-ujis.c2
-rw-r--r--strings/ctype-utf8.c3
-rw-r--r--strings/ctype-win1250ch.c2
-rw-r--r--strings/ctype.c1
-rw-r--r--strings/decimal.c21
-rw-r--r--strings/do_ctype.c3
-rw-r--r--strings/dump_map.c1
-rw-r--r--strings/my_strchr.c2
-rw-r--r--strings/my_vsnprintf.c2
-rw-r--r--strings/str_alloc.c3
-rw-r--r--strings/strappend.c10
-rw-r--r--strings/strcend.c9
-rw-r--r--strings/strmake.c3
-rw-r--r--strings/uca-dump.c1
-rw-r--r--strings/utr11-dump.c1
32 files changed, 69 insertions, 48 deletions
diff --git a/strings/CMakeLists.txt b/strings/CMakeLists.txt
index 8d35c732333..2747374058d 100644
--- a/strings/CMakeLists.txt
+++ b/strings/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c
index aebeafcda98..7dfc76e5417 100644
--- a/strings/conf_to_src.c
+++ b/strings/conf_to_src.c
@@ -1,4 +1,5 @@
/* Copyright (c) 2000-2003, 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Copyright (c) 2009-2011, Monty Program Ab
Use is subject to license terms.
Copyright (c) 2009-2011, Monty Program Ab
diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c
index 1b8e2fb5f3a..7c7d8c7b2f5 100644
--- a/strings/ctype-big5.c
+++ b/strings/ctype-big5.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c
index 8f09561fb16..d28d576c661 100644
--- a/strings/ctype-bin.c
+++ b/strings/ctype-bin.c
@@ -1,5 +1,4 @@
-/* Copyright tommy@valley.ne.jp.
- Copyright (c) 2002, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2002-2007 MySQL AB & tommy@valley.ne.jp
Copyright (c) 2009-2011, Monty Program Ab
This library is free software; you can redistribute it and/or
diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c
index ffab57a7d96..b7847e4509e 100644
--- a/strings/ctype-cp932.c
+++ b/strings/ctype-cp932.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c
index 08c8412e8ae..36fc6b36f0c 100644
--- a/strings/ctype-czech.c
+++ b/strings/ctype-czech.c
@@ -1,5 +1,6 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2000-2007 MySQL AB
Copyright (c) 2009-2011, Monty Program Ab
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c
index 77296f34f6a..3caa1977c0b 100644
--- a/strings/ctype-euc_kr.c
+++ b/strings/ctype-euc_kr.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c
index b52cc603e4d..e0499c6f2e3 100644
--- a/strings/ctype-extra.c
+++ b/strings/ctype-extra.c
@@ -6,7 +6,8 @@
./conf_to_src ../sql/share/charsets/ > FILE
*/
-/* Copyright (c) 2003, 2010, Oracle and/or its affiliates.
+/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c
index af6c6f9f8c2..b27ea67059d 100644
--- a/strings/ctype-gb2312.c
+++ b/strings/ctype-gb2312.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c
index 601bbabddb5..8b37de4a5e7 100644
--- a/strings/ctype-gbk.c
+++ b/strings/ctype-gbk.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c
index f5456c1a943..80ae11c82c2 100644
--- a/strings/ctype-latin1.c
+++ b/strings/ctype-latin1.c
@@ -1,6 +1,6 @@
/* Copyright (c) 2000, 2003-2007 MySQL AB, 2009 Sun Microsystems, Inc.
- Use is subject to license terms.
Copyright (c) 2009-2011, Monty Program Ab
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c
index 33e0c58cbbf..5879bdf7978 100644
--- a/strings/ctype-mb.c
+++ b/strings/ctype-mb.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index eb8c44805da..e60f9307e39 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -1,5 +1,6 @@
-/* Copyright (c) 2002, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2002-2007 MySQL AB, 2009 Sun Microsystems, Inc.
Copyright (c) 2009-2011, Monty Program Ab
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c
index 042ceab4f35..50756799a56 100644
--- a/strings/ctype-sjis.c
+++ b/strings/ctype-sjis.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c
index f6fe4c0f914..d97f8e5ff08 100644
--- a/strings/ctype-tis620.c
+++ b/strings/ctype-tis620.c
@@ -1,20 +1,5 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/*
Copyright (C) 2003 by Sathit Jittanupat
<jsat66@hotmail.com,jsat66@yahoo.com>
* solving bug crash with long text field string
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index b5f151c4d10..7dc1527002f 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -1,5 +1,6 @@
-/* Copyright (c) 2004, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2004-2007 MySQL AB, 2009 Sun Microsystems, Inc.
Copyright (c) 2009-2011, Monty Program Ab
+ Use is subject to license terms.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index b22ca43a062..a780a296a9b 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2003, 2010, Oracle and/or its affiliates
Copyright (c) 2009-2011, Monty Program Ab
This library is free software; you can redistribute it and/or
diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c
index 32d65a07f23..ecb0992c70d 100644
--- a/strings/ctype-ujis.c
+++ b/strings/ctype-ujis.c
@@ -1,5 +1,5 @@
/* Copyright tommy@valley.ne.jp.
- Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2002, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This library is free software; you can redistribute it and/or
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index daca63437ca..81198147363 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -1,5 +1,6 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2002-2008 MySQL AB, 2009 Sun Microsystems, Inc.
Copyright (c) 2009-2011, Monty Program Ab
+ Use is subject to license terms.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c
index a22fe7b696f..8fd15ebddb2 100644
--- a/strings/ctype-win1250ch.c
+++ b/strings/ctype-win1250ch.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2001 Jan Pazdziora.
- Copyright (c) 2002, 2010, Oracle and/or its affiliates.
+ Copyright (c) 2002-2007 MySQL AB
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
diff --git a/strings/ctype.c b/strings/ctype.c
index 296960b55b5..6b6983ada60 100644
--- a/strings/ctype.c
+++ b/strings/ctype.c
@@ -1,4 +1,5 @@
/* Copyright (c) 2000-2007 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
+ Copyright (c) 2009-2011, Monty Program Ab
Use is subject to license terms.
Copyright (c) 2009-2011, Monty Program Ab
diff --git a/strings/decimal.c b/strings/decimal.c
index 8ac3d61612d..c0021da6570 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1474,9 +1474,8 @@ decimal_round(const decimal_t *from, decimal_t *to, int scale,
{
int frac0=scale>0 ? ROUND_UP(scale) : scale/DIG_PER_DEC1,
frac1=ROUND_UP(from->frac), UNINIT_VAR(round_digit),
- intg0=ROUND_UP(from->intg), error=E_DEC_OK, len=to->len,
- intg1=ROUND_UP(from->intg +
- (((intg0 + frac0)>0) && (from->buf[0] == DIG_MAX)));
+ intg0=ROUND_UP(from->intg), error=E_DEC_OK, len=to->len;
+
dec1 *buf0=from->buf, *buf1=to->buf, x, y, carry=0;
int first_dig;
@@ -1491,6 +1490,12 @@ decimal_round(const decimal_t *from, decimal_t *to, int scale,
default: DBUG_ASSERT(0);
}
+ /*
+ For my_decimal we always use len == DECIMAL_BUFF_LENGTH == 9
+ For internal testing here (ifdef MAIN) we always use len == 100/4
+ */
+ DBUG_ASSERT(from->len == to->len);
+
if (unlikely(frac0+intg0 > len))
{
frac0=len-intg0;
@@ -1504,17 +1509,17 @@ decimal_round(const decimal_t *from, decimal_t *to, int scale,
return E_DEC_OK;
}
- if (to != from || intg1>intg0)
+ if (to != from)
{
dec1 *p0= buf0+intg0+max(frac1, frac0);
- dec1 *p1= buf1+intg1+max(frac1, frac0);
+ dec1 *p1= buf1+intg0+max(frac1, frac0);
+
+ DBUG_ASSERT(p0 - buf0 <= len);
+ DBUG_ASSERT(p1 - buf1 <= len);
while (buf0 < p0)
*(--p1) = *(--p0);
- if (unlikely(intg1 > intg0))
- to->buf[0]= 0;
- intg0= intg1;
buf0=to->buf;
buf1=to->buf;
to->sign=from->sign;
diff --git a/strings/do_ctype.c b/strings/do_ctype.c
index addb3a3d7f6..55e319a2295 100644
--- a/strings/do_ctype.c
+++ b/strings/do_ctype.c
@@ -1,5 +1,6 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2000-2002, 2006, 2007 MySQL AB
Copyright (c) 2009-2011, Monty Program Ab
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/strings/dump_map.c b/strings/dump_map.c
index 83d35f259a1..debc44d6f5f 100644
--- a/strings/dump_map.c
+++ b/strings/dump_map.c
@@ -1,4 +1,5 @@
/* Copyright (c) 2003, 2004, 2006 MySQL AB
+ Copyright (c) 2009-2011, Monty Program Ab
Use is subject to license terms.
Copyright (c) 2009-2011, Monty Program Ab
diff --git a/strings/my_strchr.c b/strings/my_strchr.c
index 9bb1f0954ed..0305ef89542 100644
--- a/strings/my_strchr.c
+++ b/strings/my_strchr.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2005, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c
index dde6b0255ed..8d8c078849c 100644
--- a/strings/my_vsnprintf.c
+++ b/strings/my_vsnprintf.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
diff --git a/strings/str_alloc.c b/strings/str_alloc.c
index 3e218ff1fbd..17139e7b773 100644
--- a/strings/str_alloc.c
+++ b/strings/str_alloc.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2005, 2006 MySQL AB
+/* Copyright (c) 2005, 2006 MySQL AB
+ Copyright (c) 2009-2011, Monty Program Ab
Use is subject to license terms.
Copyright (c) 2009-2011, Monty Program Ab
diff --git a/strings/strappend.c b/strings/strappend.c
index 29d38e74fb5..2d04f009a60 100644
--- a/strings/strappend.c
+++ b/strings/strappend.c
@@ -26,6 +26,16 @@
SUCH DAMAGE.
*/
+/* File : strappend.c
+ Author : Monty
+ Updated: 1987.02.07
+ Defines: strappend()
+
+ strappend(dest, len, fill) appends fill-characters to a string so that
+ the result length == len. If the string is longer than len it's
+ trunked. The des+len character is allways set to NULL.
+*/
+
#include "strings_def.h"
void strappend(register char *s, size_t len, pchar fill)
diff --git a/strings/strcend.c b/strings/strcend.c
index 35f103fc40a..55b05bfcefa 100644
--- a/strings/strcend.c
+++ b/strings/strcend.c
@@ -26,6 +26,15 @@
SUCH DAMAGE.
*/
+/* File : strcend.c
+ Author : Michael Widenius: ifdef MC68000
+ Updated: 20 April 1984
+ Defines: strcend()
+
+ strcend(s, c) returns a pointer to the first place in s where c
+ occurs, or a pointer to the end-null of s if c does not occur in s.
+*/
+
#include "strings_def.h"
char *strcend(register const char *s, register pchar c)
diff --git a/strings/strmake.c b/strings/strmake.c
index b6f37dd3d88..951a589e360 100644
--- a/strings/strmake.c
+++ b/strings/strmake.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2001, 2003, 2006-2008 MySQL AB, 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2009-2011, Monty Program Ab
Use is subject to license terms.
Copyright (c) 2009-2011, Monty Program Ab
diff --git a/strings/uca-dump.c b/strings/uca-dump.c
index ab3437d17df..d5c20854636 100644
--- a/strings/uca-dump.c
+++ b/strings/uca-dump.c
@@ -1,4 +1,5 @@
/* Copyright (c) 2004, 2006 MySQL AB
+ Copyright (c) 2009-2011, Monty Program Ab
Use is subject to license terms.
Copyright (c) 2009-2011, Monty Program Ab
diff --git a/strings/utr11-dump.c b/strings/utr11-dump.c
index 8bd5e9ee58b..0806b3ba0cd 100644
--- a/strings/utr11-dump.c
+++ b/strings/utr11-dump.c
@@ -1,4 +1,5 @@
/* Copyright (c) 2004, 2006 MySQL AB
+ Copyright (c) 2009-2011, Monty Program Ab
Use is subject to license terms.
Copyright (c) 2009-2011, Monty Program Ab