MariaDB server is a community developed fork of MySQL server. Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry.
Find a file
unknown 819eaead10 Fix for a BUG#31898: 16M memory allocations for user variables
in stored procedure.

The problem was that MySQL used unnecessarily large amounts of
memory if user variables were used as an argument to CONCAT or
CONCAT_WS -- 16M per each user variable used.

Technically, it happened because MySQL used the following
allocation strategy for string functions to avoid multiple
realloc() calls: in the virtual operation fix_length_and_dec()
the attribute max_length was calculated as a sum of max_length
values for each argument.

Although this approach worked well for small (or fixed) data types,
there could be a problem if there as a user variable among
the arguments of a string function -- max_length of the function
would be 16M (as the max_length of a user variable is 16M).

Both CONCAT() and CONCAT_WS() functions suffer from this problem.

The fix is to do not use meta-data for allocating memory.
The following strategy is proposed instead: allocate the exact
length of the result string at the first record, double the amount
of memory allocated when it is required.

No test case for this bug because there is no way to test memory
consumption in a robust way with our test suite.


sql/item_strfunc.cc:
  Implement memory-wise allocation strategy.
2007-11-12 14:44:17 +03:00
BitKeeper Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build-work 2007-10-30 15:24:17 +01:00
BUILD autorun.sh: 2007-10-29 22:48:58 +01:00
client Merge mysql.com:/home/gluh/MySQL/Merge/5.1 2007-10-23 19:08:21 +05:00
cmd-line-utils Merge mysql.com:/home/kent/bk/bug24809/mysql-5.0-build 2007-10-31 10:52:18 +01:00
config/ac-macros Merge polly.(none):/home/kaa/src/maint/bug31254/my51-bug31254 2007-10-12 15:10:33 +04:00
dbug Bug #27099: system_mysql fail in pushbuild windows 2007-10-15 19:56:24 +03:00
Docs Merge mysql.com:/home/kent/bk/tmp/mysql-5.0-build 2007-03-22 19:44:14 +01:00
extra Merge ramayana.hindu.god:/home/tsmith/m/bk/51 2007-10-10 14:15:09 -06:00
include Cleanup: use helper functions to set an error in MYSQL or MYSQL_STMT. 2007-10-31 17:16:53 +03:00
libmysql Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime 2007-10-31 17:30:46 +03:00
libmysql_r Makefile.am: 2007-09-26 19:41:46 +02:00
libmysqld Cleanup: use helper functions to set an error in MYSQL or MYSQL_STMT. 2007-10-31 17:16:53 +03:00
man my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
mysql-test Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime 2007-11-06 15:41:12 +02:00
mysys Merge anubis.xiphis.org:/usr/home/antony/work/mysql-5.1-engines 2007-10-19 13:06:37 -07:00
netware Minor Makefile fixes: 2007-10-30 20:06:49 +01:00
plugin Makefile.am: 2007-09-26 18:47:55 +02:00
pstack Makefile.am, configure.in: 2007-09-27 21:39:23 +02:00
regex Merge bk-internal.mysql.com:/home/bk/mysql-5.1-marvel 2007-08-16 18:21:47 +02:00
scripts Merge trift2.:/MySQL/M51/mysql-5.1 2007-10-29 12:56:48 +01:00
server-tools WL#4104: Deprecate the Instance Manager. 2007-10-22 23:02:05 +04:00
sql Fix for a BUG#31898: 16M memory allocations for user variables 2007-11-12 14:44:17 +03:00
sql-bench Fixed compiler warnings 2007-02-23 13:13:55 +02:00
sql-common Another attempt to fix the Windows compilation failre. 2007-11-01 00:55:25 +03:00
storage Merge whalegate.ndb.mysql.com:/home/tomas/cge-5.1 2007-11-01 11:37:32 +01:00
strings Merge mysql.com:/home/gluh/MySQL/Merge/5.1 2007-10-23 19:08:21 +05:00
support-files Makefile.am, make_binary_distribution.sh: 2007-09-27 12:21:56 +02:00
tests Post merge fix for bug 31669. 2007-10-31 13:54:53 -02:00
unittest Fixes Bug#30127: --debug-info no longer prints memory usage in mysql 2007-08-01 22:59:05 +03:00
vio Merge pilot.(none):/data/msvensson/mysql/mysql-5.0-maint 2007-08-28 11:36:10 +02:00
win Merge ramayana.hindu.god:/home/tsmith/m/bk/51 2007-09-28 10:55:28 -06:00
zlib CMakeLists.txt, README, configure.js 2007-08-03 21:51:37 +02:00
.bzrignore disable tests 2007-11-01 12:02:41 +01:00
.cvsignore Import changeset 2000-07-31 21:29:14 +02:00
CMakeLists.txt Merge alf.(none):/src/bug31289/my50-bug31289 2007-10-08 13:01:06 -04:00
configure.in 5.1 has been promoted to "rc" status. 2007-10-29 20:00:36 +01:00
COPYING - manual.texi will be replaced with a manual written in DocBook/XML. This ChangeSet removes all 2005-04-13 11:51:38 +02:00
EXCEPTIONS-CLIENT EXCEPTIONS-CLIENT: 2007-03-14 18:28:16 +01:00
Makefile.am Minor Makefile fixes: 2007-10-30 20:06:49 +01:00
README make_binary_distribution.sh: 2006-11-07 22:26:37 +01:00

This is a release of MySQL, a dual-license SQL database server.
MySQL is brought to you by the MySQL team at MySQL AB.

License information can be found in these files:
- For GPL (free) distributions, see the COPYING file and
  the EXCEPTIONS-CLIENT file.
- For commercial distributions, see the LICENSE.mysql file.


For further information about MySQL or additional documentation, see:
- The latest information about MySQL: http://www.mysql.com
- The current MySQL documentation: http://dev.mysql.com/doc

Some manual sections of special interest:

- If you are migrating from an older version of MySQL, please read the
  "Upgrading from..." section first!
- To see what MySQL can do, take a look at the features section.
- For installation instructions, see the Installing and Upgrading chapter.
- For the new features/bugfix history, see the Change History appendix.
- For the currently known bugs/misfeatures (known errors) see the Problems
  and Common Errors appendix.
- For a list of developers and other contributors, see the Credits
  appendix.

A local copy of the MySQL Reference Manual can be found in the Docs
directory in GNU Info format.  You can also browse the manual online or
download it in any of several formats at the URL given earlier in this
file.

************************************************************

IMPORTANT:

Bug or error reports should be sent to http://bugs.mysql.com.