Commit graph

1712 commits

Author SHA1 Message Date
Magnus Blåudd
58628cbbb4 Merge bug#42850 to 5.0 2009-09-28 14:40:20 +02:00
Magnus Blåudd
9eab1cdb9a Bug#42850 race condition in my_thr_init.c
- Create the "dummy" thread joinable and wait for it to
   exit before continuing in 'my_thread_global_init'
 - This way we know that the pthread library is initialized
   by one thread only
2009-09-24 08:30:31 +02:00
Georgi Kodinov
45c70a2ec5 fixed compilation warnings 2009-09-24 16:21:46 +03:00
Staale Smedseng
e5888b16af Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
      
This is the fifth patch cleaning up more GCC warnings about
variables used before initialized using the new macro
UNINIT_VAR().
2009-09-17 17:10:30 +02:00
Ingo Struewing
540b2dc004 Bug#17332 - changing key_buffer_size on a running server
can crash under load

Backport from 5.1.
Does also include key cache fixes from:
Bug 44068 (RESTORE can disable the MyISAM Key Cache)
Bug 40944 (Backup: crash after myisampack)



include/keycache.h:
  Bug#17332 - changing key_buffer_size on a running server
              can crash under load
  Added KEY_CACHE components in_resize and waiting_for_resize_cnt.
myisam/mi_preload.c:
  Bug#17332 - changing key_buffer_size on a running server
              can crash under load
  Added code to allow LOAD INDEX to load indexes of different block size.
mysys/mf_keycache.c:
  Bug#17332 - changing key_buffer_size on a running server
              can crash under load
  .
  Changed resize_key_cache() to not disable the key cache
  after the flush phase. Changed queue handling to use
  standard functions. Wake all threads waiting on resize_queue.
  We can now have read/write threads waiting there (see below).
  .
  Combined add_to_queue() and the wait loops that were always
  following it to the new function wait_on_queue().
  Combined release_queue() and the condition that was always
  preceding it to the new function release_whole_queue().
  .
  Added code to flag and respect the exceptional situation
  BLOCK_IN_EVICTION.
  .
  Rewrote the resize branch of find_key_block().
  .
  Added code to the eviction handling in find_key_block()
  to catch more exceptional cases.
  .
  Changed key_cache_read(), key_cache_insert() and key_cache_write()
  so that they lock keycache->cache_lock whenever the key cache is
  initialized. Checking for a disabled cache and incrementing and
  decrementing the "resize counter" is always done within the lock.
  Locking and unlocking as well as counting the "resize counter" is
  now done once outside the loop. All three functions can now handle
  a NULL return from find_key_block. This happens in the flush phase
  of a resize and demands direct file I/O. Care is taken for
  secondary requests (PAGE_WAIT_TO_BE_READ) to wait in any case.
  Moved block status changes behind the copying of buffer data.
  key_cache_insert() does now read the block if the caller did
  supply less data than a full cache block.
  key_cache_write() does now take care of parallel running flushes
  (BLOCK_FOR_UPDATE, BLOCK_IN_FLUSHWRITE).
  .
  Changed free_block() to un-initialize block variables in the
  correct order and respect an exceptional BLOCK_IN_EVICTION state.
  .
  Changed flushing to take care for parallel running writes.
  Changed flushing to avoid freeing blocks in eviction.
  Changed flushing to consider that parallel writes can move blocks
  from the file_blocks hash to the changed_blocks hash.
  Changed flushing to take care for other parallel flushes.
  Changed flushing to assure that it ends with everything flushed.
  Optimized normal flush at end of statement (FLUSH_KEEP),
  but let other flush types be stringent.
  .
  Added some comments and debugging statements.
mysys/my_static.c:
  Bug#17332 - changing key_buffer_size on a running server
              can crash under load
  Removed an unused global variable.
sql/ha_myisam.cc:
  Bug#17332 - changing key_buffer_size on a running server
              can crash under load
  Moved an automatic (stack) variable to the scope where it is used.
sql/sql_table.cc:
  Bug#17332 - changing key_buffer_size on a running server
              can crash under load
  Changed TL_READ to TL_READ_NO_INSERT in mysql_preload_keys.
2009-09-07 18:35:37 +02:00
Satya B
2fc9c5d199 Fix for BUG#46591 - .frm file isn't sync'd with sync_frm enabled for
CREATE TABLE...LIKE...
      
The mysql server option 'sync_frm' is ignored when table is created with 
syntax CREATE TABLE .. LIKE.. 
      
Fixed by adding the MY_SYNC flag and calling my_sync() from my_copy() when
the flag is set.

In mysql_create_table(), when the 'sync_frm' is set, MY_SYNC flag is passed 
to my_copy(). 
      
Note: TestCase is not attached and can be tested manually using debugger.

client/Makefile.am:
  BUG#46591 - .frm file isn't sync'd with sync_frm enabled for 
              CREATE TABLE...LIKE...
      
  add my_sync to sources as it is used in my_copy() method
include/my_sys.h:
  BUG#46591 - .frm file isn't sync'd with sync_frm enabled for 
              CREATE TABLE...LIKE...
      
  MY_SYNC flag is added to call my_sync() method
mysys/my_copy.c:
  BUG#46591 - .frm file isn't sync'd with sync_frm enabled for 
              CREATE TABLE...LIKE...
      
  my_sync() is method is called when MY_SYNC is set in my_copy()
sql/sql_table.cc:
  BUG#46591 - .frm file isn't sync'd with sync_frm enabled for 
              CREATE TABLE...LIKE...
      
  Fixed mysql_create_like_table() to call my_sync() when opt_sync_frm variable
  is set
2009-09-03 16:02:03 +05:30
Georgi Kodinov
607c399f8b merge 2009-09-02 15:33:18 +03:00
Davi Arnaut
e512d69434 Post-merge fix. Observe C declaration placement rules. 2009-09-02 09:02:22 -03:00
Anurag Shekhar
df51d1cea0 merging with changes in bugteam branch. 2009-08-31 13:02:31 +05:30
Staale Smedseng
1ba25ae47c Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
      
This patch fixes a number of GCC warnings about variables used
before initialized. A new macro UNINIT_VAR() is introduced for
use in the variable declaration, and LINT_INIT() usage will be
gradually deprecated. (A workaround is used for g++, pending a
patch for a g++ bug.)
      
GCC warnings for unused results (attribute warn_unused_result)
for a number of system calls (present at least in later
Ubuntus, where the usual void cast trick doesn't work) are
also fixed.


client/mysqlmanager-pwgen.c:
  A fix for warn_unused_result, adding fallback to use of
  srand()/rand() if /dev/random cannot be used. Also actually
  adds calls to rand() in the second branch so that it actually
  creates a random password.
2009-08-28 17:51:31 +02:00
Anurag Shekhar
11dd1d6d84 Bug #44723 Larger read_buffer_size values can cause performance
decrease for INSERTs


Bulk inserts (multiple row, CREATE ... SELECT, INSERT ... SELECT) into
MyISAM tables were performed inefficiently. This was mainly affecting
use cases where read_buffer_size was considerably large (>256K) and low
number of rows was inserted (e.g. 30-100).

The problem was that during I/O cache initialization (this happens
before each bulk insert) allocated I/O buffer was unnecessarily
initialized to '\0'.

This was happening because of mess in flag values. MyISAM informs I/O
cache to wait for free space (if out of disk space) by passing
MY_WAIT_IF_FULL flag. Since MY_WAIT_IF_FULL and MY_ZEROFILL have the
same values, memory allocator was initializing memory to '\0'.

The performance gain provided with this patch may only be visible with
non-debug binaries, since safemalloc always initializes allocated memory
to 0xA5A5...

mysys/mf_iocache.c:
  Remove MY_WAIT_IF_FULL from myflags before calling my_malloc
  to prevent conflict with MY_ZEROFILL.
2009-08-24 13:15:51 +05:30
Ignacio Galarza
09877515f2 Bug#17270 - mysql client tool could not find ../share/charsets folder and fails.
- Define and pass compile time path variables as pre-processor definitions to 
  mimic the makefile build.
- Set new CMake version and policy requirements explicitly.
- Changed DATADIR to MYSQL_DATADIR to avoid conflicting definition in 
  Platform SDK header ObjIdl.h which also defines DATADIR.
2009-07-31 15:22:02 -04:00
V Narayanan
5a0a258ec6 Bug#43572 Handle failures from hash_init
This patch is a follow up to http://lists.mysql.com/commits/76678.
When an allocation failure occurs for the buffer in the dynamic
array, an error condition was being set. The dynamic array is
usable even if the memory allocation fails. Since in most cases
the thread can continue to work without any problems the error
condition should not be set here.

This patch adds logic to remove the error condition from being set
when the memory allocation for the buffer in dynamic array fails.

mysys/array.c:
  Bug#43572 Handle failures from hash_init
  
  Remove the MY_WME flag from the call to malloc in order to
  prevent the error status from being set in the init_dynamic_array
  method. Since this memory allocation failure is no longer
  fatal this method has been modified to return FALSE
  (indicate success) irrespective of array->buffer being
  allocated.
2009-07-12 11:18:53 +05:30
V Narayanan
336c810618 Bug#43572 Handle failures from hash_init
Failure to allocate memory for the hash->array element,
caused hash_init to return without initializing the other
members of the hash. Thus although the dynamic array
buffer may be allocated at a later point in the code, the
incompletely initialized hash caused fatal failures.

This patch moves the initialization of the other members
of the hash above the array allocation, so that the usage
of this hash will not result in fatal failures.

include/hash.h:
  Bug#43572 Handle failures from hash_init
  
  hash_inited is used to verify that the hash is
  valid. After the change induced by the current
  patch hash->array.buffer !=0 is not a valid check
  for this condition, since, the dynamic array can
  be allocated even at a later time. Bootstrap SQL
  script is setting some variables, which are
  actually not set due to this hash_inited issue.
  Thus we get empty grant tables.
  
  A better way to check if the hash is valid is
  to verify that hash->blength is greater than 0.
mysys/hash.c:
  Bug#43572 Handle failures from hash_init
  
  Move the initialization of the other members
  of the hash above the array allocation, so that
  the usage of this hash will not result in fatal
  failures.
2009-06-19 17:29:21 +05:30
Jim Winstead
df3887f913 The get_date() function in mysys interpreted the GETDATE_GMT option
backwards, which resulted in the incorrect time being reported at the
end of mysqldump. (Bug #44424, patch by Andrew Hutchings)
2009-05-07 11:17:07 -07:00
Davi Arnaut
27e3214b49 Bug#43461: invalid comparison with string literal in default.c
Don't compare string literals as it results in unspecified behavior.

mysys/default.c:
  Test for a empty string.
2009-03-19 17:20:15 -03:00
Ignacio Galarza
675c3ce2bb auto-merge 2009-03-19 09:44:58 -04:00
Georgi Kodinov
3033ea85a2 Bug #42434: license of mysys MD5 implementation is not GPL-compatible
Took the Xfree implementation (based on the same rewrite as the NDB one)
and added it instead of the current implementation.
Added a macro to make the calls to MD5 more streamlined. 

client/mysqlmanager-pwgen.c:
  Bug #42434: changed to call the macro
include/my_md5.h:
  Bug #42434: use the Xfree implementation
mysys/md5.c:
  Bug #42434: use the Xfree implementation
sql/item_strfunc.cc:
  Bug #42434: changed to call the macro
sql/table.cc:
  Bug #42434: changed to call the macro
tools/mysqlmanager.c:
  Bug #42434: changed to call the macro
2009-03-09 20:57:03 +02:00
He Zhenxing
82fc35475c BUG#22082 Slave hangs(holds mutex) on "disk full"
When disk is full, server may waiting for free space while
writing binlog, relay-log or MyISAM tables. The server will 
continue after user have freed some space. But the error
message printed was not quite clear about the how often the
error message is printed, and there will be a delay before
the server continue and user freeing space. And caused users
thinking that the server was hanging forever.

This patch fixed the problem by making the error messages
printed more clear. The error message is split into two part,
the first part will only be printed once, and the second part
will be printed very 10 times.

Message first part:
Disk is full writing '<filename>' (Errcode: <errorno>). Waiting
for someone to free space... (Expect up to 60 secs delay for 
server to continue after freeing disk space)

Message second part:
Retry in 60 secs, Message reprinted in 600 secs
2009-03-06 17:32:00 +08:00
Ignacio Galarza
54fbbf9591 Bug#29125 Windows Server X64: so many compiler warnings
- Remove bothersome warning messages.  This change focuses on the warnings 
that are covered by the ignore file: support-files/compiler_warnings.supp.
- Strings are guaranteed to be max uint in length
2009-02-10 17:47:54 -05:00
Vladislav Vaintroub
60d5e90089 Bug#36279 - mysql built with Visual Studio 2005 does not display
japanese characters.

Fix - removed obsolvete setlocale from my_init.c . In MBCS 
environments it caused unwanted character-to-byte translations
in fputc()  in client code and wrong output as result.
2008-11-10 21:18:04 +01:00
Alexey Botchkov
8d3eb141e0 merging fix 2008-08-26 13:32:43 +05:00
Davi Arnaut
1ee4a3ac82 Bug#36579 Dumping information about locks in use may lead to a server crash
Dumping information about locks in use by sending a SIGHUP signal
to the server or by invoking the "mysqladmin debug" command may
lead to a server crash in debug builds or to undefined behavior in
production builds.

The problem was that a mutex that protects a lock object (THR_LOCK)
might have been destroyed before the lock object was actually removed
from the list of locks in use, causing a race condition with other
threads iterating over the list. The solution is to destroy the mutex
only after removing lock object from the list.

mysys/thr_lock.c:
  Destroy the mutex that protects the lock object only after removing
  the lock object from the list of locks in use.
2008-08-25 10:18:52 -03:00
Alexey Botchkov
ec524d50a8 Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
test_if_data_home_dir fixed to look into real path.
            Checks added to mi_open for symlinks into data home directory.

per-file messages:
        include/my_sys.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          my_is_symlink interface added
        include/myisam.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          myisam_test_invalid_symlink interface added
        myisam/mi_check.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          mi_open_datafile calls modified
        myisam/mi_open.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          code added to mi_open to check for symlinks into data home directory.
          mi_open_datafile now accepts 'original' file path to check if it's
          an allowed symlink.
        myisam/mi_static.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          myisam_test_invlaid_symlink defined
        myisam/myisamchk.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          mi_open_datafile call modified
        myisam/myisamdef.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          mi_open_datafile interface modified - 'real_path' parameter added
        mysql-test/r/symlink.test
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          error codes corrected as some patch now rejected pointing inside datahome
        mysql-test/r/symlink.result
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          error messages corrected in the result
        mysys/my_symlink.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          my_is_symlink() implementsd
          my_realpath() now returns the 'realpath' even if a file isn't a symlink
        sql/mysql_priv.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          test_if_data_home_dir interface
        sql/mysqld.cc
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          myisam_test_invalid_symlik set with the 'test_if_data_home_dir'
        sql/sql_parse.cc
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          error messages corrected
          test_if_data_home_dir code fixed
2008-08-22 17:31:53 +05:00
Chad MILLER
ace51b79f1 Bug#30394: Empty HOME environment variable causes several utilities to crash
Tilde expansion could fail when it was to expand to an empty string (such as
when HOME is set to an empty string), especially on systems where size_t is
unsigned.
2008-08-18 13:06:27 -04:00
Marc Alff
2f3b860305 Merge mysql-5.0-bugteam -> local bugfix branch 2008-08-11 15:21:29 -06:00
Marc Alff
b4418b5c3a Bug#37302 (missing DBUG_RETURN macro in function "find_key_block" (5.0 only))
Fixed missing DBUG_RETURN in the function find_key_block
2008-08-11 15:08:12 -06:00
Marc Alff
e04dfffb59 Bug#38296 (low memory crash with many conditions in a query)
This fix is for 5.0 only : back porting the 6.0 patch manually

The parser code in sql/sql_yacc.yy needs to be more robust to out of
memory conditions, so that when parsing a query fails due to OOM,
the thread gracefully returns an error.

Before this fix, a new/alloc returning NULL could:
- cause a crash, if dereferencing the NULL pointer,
- produce a corrupted parsed tree, containing NULL nodes,
- alter the semantic of a query, by silently dropping token values or nodes

With this fix:
- C++ constructors are *not* executed with a NULL "this" pointer
when operator new fails.
This is achieved by declaring "operator new" with a "throw ()" clause,
so that a failed new gracefully returns NULL on OOM conditions.

- calls to new/alloc are tested for a NULL result,

- The thread diagnostic area is set to an error status when OOM occurs.
This ensures that a request failing in the server properly returns an
ER_OUT_OF_RESOURCES error to the client.

- OOM conditions cause the parser to stop immediately (MYSQL_YYABORT).
This prevents causing further crashes when using a partially built parsed
tree in further rules in the parser.

No test scripts are provided, since automating OOM failures is not
instrumented in the server.
Tested under the debugger, to verify that an error in alloc_root cause the
thread to returns gracefully all the way to the client application, with
an ER_OUT_OF_RESOURCES error.
2008-08-11 10:10:00 -06:00
Timothy Smith
aa5731dad9 Bug #38180 options are read from ~/my.cnf instead of ~/.my.cnf
Pull out some of unpack_dirname() into normalize_dirname(); this
new function does not expand "~" to the home directory.  Use this
function in unpack_dirname(), and use it during init_default_directories()
to remove duplicate entries without losing track of which directory
is a user's home dir.
2008-07-16 16:58:45 -06:00
Georgi Kodinov
3bcbaf6cbf fixed a compilation warning on windows 64. 2008-07-09 13:03:48 +03:00
Timothy Smith
5647bce366 Fix "C++ code in C file" syntax error in mysys/default.c 2008-07-02 16:37:29 +02:00
Timothy Smith
d5977e4c44 Bug #20748: Configuration files should not be read more than once
Normalize directory names before adding them to default_directories.


mysys/default.c:
  Normalize directory names with unpack_dirname() before adding them
  to default_directories.  This way, /etc/ and /etc will not count as
  duplicates.
  
  Because this entails allocating memory to store the normalized names,
  add error handling and ensure that it doesn't leak memory in case
  both my_print_defaults() and load_defaults() are called.
  
  Clean up the Windows code that finds the exe's parent directory, and
  pull it out into a separate function.
  
  Reorganize the code into a single init_default_directories() function,
  with internal #ifdefs, instead of init_default_directories_<system>()
  functions which were accessed via a function pointer.  This is more in
  line with normal MySQL coding style, and easier to read for some.
2008-06-24 19:25:23 -06:00
Hakan Kuecuekyilmaz
f3a81ef408 Fix for Bug#16902.
mysys/errors.c:
  Fixed typo, Bug#16902.
2008-06-16 10:05:00 +02:00
unknown
65a310fe2a revert the push of bug 35616. 2008-05-06 11:57:19 +03:00
unknown
55c336fd0e Bug#35616: memory overrun on 64-bit linux on setting large values for keybuffer-size
We could allocate chunks larger than 4GB, but did our size-accounting in 32-bit
values. This could lead to spurious warnings, inaccurate accounting, and, in
theory, data loss.

Affected: 64-bit platforms. Debug-build (with safemalloc). At least one buffer
larger than 4GB. For potential data loss, a re-alloc on such a buffer would be
necessary.


mysys/my_static.c:
  Make memory-accounting 64-bit safe.
mysys/my_static.h:
  Make memory-accounting 64-bit safe.
  Move in struct for better alignment when 64-bit.
2008-05-06 02:55:35 +02:00
unknown
8def2e0993 Avoid compilation problem on AIX. 2008-04-28 13:41:12 -04:00
unknown
11714e6842 fixed warnings from the fix of 26243 2008-03-29 17:50:46 +02:00
unknown
162eadbe68 Fix for bug #31781: multi-table UPDATE with temp-pool enabled fails
with errno 17

my_create() did not perform any checks for the case when a file is
successfully created by a call to open(), but the call to
my_register_filename() later fails because the number of open files
has exceeded the my_open_files limit. This can happen on platforms 
which do not have getrlimit(), and hence we do not know the real limit
for open files. In such a case an error was returned to a caller
although the file has actually been created. Since callers assume
my_create() to return an error only when it failed to create a file,
they did not perform any cleanups, leaving an 'orphaned' file on the
file system.

Fixed by adding a check for the above case to my_create() and ensuring
the newly created file is deleted before returning an error.

Creating a deterministic test case in the test suite is impossible,
because the exact steps required to reproduce the above situation
depend on the platform and/or environment (OS per-user limits, queries
executed by previous tests, startup parameters). The patch was
manually tested on Windows using examples posted in the bug report.


mysys/my_create.c:
  Ensure that, if the call to my_register_filename() in my_create()
  failed, but the previous open() called succeeded, the newly created
  file is deleted before returning an error.
2008-03-03 17:34:06 +03:00
unknown
607941de2e Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/misc/mysql/31752_/50-31752_


client/mysql.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
2007-12-17 09:45:36 +01:00
unknown
02cdb7ecca Merge mysql.com:/misc/mysql/31752_/41-31752_
into  mysql.com:/misc/mysql/31752_/50-31752_


mysys/mf_pack.c:
  Auto merged
sql/log.cc:
  Auto merged
sql/sql_show.cc:
  manual merge
sql/unireg.cc:
  manual merge
2007-12-17 09:13:38 +01:00
unknown
33f82b1789 Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt


client/mysql.cc:
  Auto merged
client/mysqltest.c:
  Auto merged
include/mysql_com.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
myisam/mi_check.c:
  Auto merged
mysql-test/r/delayed.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/myisam.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/t/merge.test:
  Auto merged
mysql-test/t/myisam.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/type_datetime.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/r/func_misc.result:
  manual merge
mysql-test/r/innodb_mysql.result:
  manual merge
mysql-test/t/func_misc.test:
  manual merge
mysql-test/t/innodb_mysql.test:
  manual merge
sql/sql_insert.cc:
  manual merge
2007-12-13 14:52:49 +04:00
unknown
0805384869 Bug#31752: check strmake() bounds
post-fixes: prevent semi-related overflow, additional comments


mysys/mf_pack.c:
  extra comments
sql/log.cc:
  prevent overflow (length parameter of strmake() should
  never become < 0)
sql/sql_show.cc:
  additional comments
sql/unireg.cc:
  additional comments
2007-12-06 11:48:27 +01:00
unknown
bfe58b71f2 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/misc/mysql/31177/50-31177


mysql-test/r/ps_2myisam.result:
  Auto merged
mysql-test/r/ps_3innodb.result:
  Auto merged
mysql-test/r/ps_4heap.result:
  Auto merged
mysql-test/r/ps_5merge.result:
  Auto merged
mysql-test/r/ps_6bdb.result:
  Auto merged
mysql-test/r/ps_7ndb.result:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
2007-12-06 08:46:01 +01:00
unknown
4618d68d6d Bug#31177: Server variables can't be set to their current values
additional fixes for BDB and correct assignment of both signed
and unsigned 64-bit data to unsigned system variables


mysql-test/r/ps_2myisam.result:
  account for UNSIGNED_FLAG
mysql-test/r/ps_3innodb.result:
  account for UNSIGNED_FLAG
mysql-test/r/ps_4heap.result:
  account for UNSIGNED_FLAG
mysql-test/r/ps_5merge.result:
  account for UNSIGNED_FLAG
mysql-test/r/ps_6bdb.result:
  account for UNSIGNED_FLAG
mysql-test/r/ps_7ndb.result:
  account for UNSIGNED_FLAG
mysys/my_getopt.c:
  We have correct signed/unsigned information now, so we no longer
  need to err on the side of caution.
sql/item_func.cc:
  Copy unsigned info over from entry so the item's data
  correctly describe it.
sql/mysqld.cc:
  BDB log buffer size: default can't be less than minimum
sql/set_var.cc:
  Handle signedness of in-values correctly when assigning to
  unsigned types, all the way up to 64-bit. Use handler from
  all three unsigned sysvar types.
sql/set_var.h:
  thd_ulonglong: Override default check with one for unsigned types
2007-12-06 01:28:01 +01:00
unknown
55a420e134 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/50


client/mysqldump.c:
  Auto merged
include/my_sys.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysql/Makefile.shared:
  Auto merged
myisam/ft_boolean_search.c:
  Auto merged
myisam/sort.c:
  Auto merged
mysql-test/t/cast.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
mysql-test/mysql-test-run.pl:
  Manual merge
mysql-test/r/ctype_ucs.result:
  Manual merge
mysql-test/r/func_misc.result:
  Manual merge
mysql-test/t/binlog_killed.test:
  Manual merge
mysql-test/t/ctype_ucs.test:
  Manual merge
mysql-test/t/func_misc.test:
  Manual merge
sql/item_strfunc.h:
  Manual merge
strings/ctype-simple.c:
  Manual merge
2007-12-04 20:58:21 -07:00
unknown
53f7db282d Bug#31177: Server variables can't be set to their current values
additional fixes for 64-bit


mysql-test/t/variables.test:
  replace 32-bit and 64-bit values
mysys/my_getopt.c:
  'mod' no longer used.
  on 64-bit, limit to (signed) (LONG)LONG_MAX to prevent badness
  in classes using longlong.
2007-12-03 10:01:56 +01:00
unknown
6a72267d05 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/misc/mysql/31177/50-31177


client/mysql.cc:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/type_bit.result:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/mysqld.cc:
  Auto merged
2007-12-02 01:48:43 +01:00
unknown
89a208850a Bug#31177: Server variables can't be set to their current values
Default values of variables were not subject to upper/lower bounds
and step, while setting variables was. Bounds and step are also
applied to defaults now; defaults are corrected quietly, values
given by the user are corrected, and a correction-warning is thrown
as needed. Lastly, very large values could wrap around, starting
from 0 again. They are bounded at the maximum value for the
respective data-type now if no lower maximum is specified in the
variable's definition.


client/mysql.cc:
  correct maxima in options array
client/mysqltest.c:
  adjust minimum for "sleep" option so default value is no longer
  out of bounds.
include/m_string.h:
  ullstr() - the unsigned brother of llstr()
include/my_getopt.h:
  Flag if we bounded the value (that is, correct anything aside from
  making value a multiple of block-size)
mysql-test/r/delayed.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/index_merge.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/innodb.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/innodb_mysql.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/key_cache.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/packet.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/ps.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/subselect.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/type_bit.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/type_bit_innodb.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/variables.result:
  correct results: bounds and step apply to variables' default values, too
mysql-test/t/variables.test:
  correct results: bounds and step apply to variables' default values, too
mysys/my_getopt.c:
  - apply bounds/step to default values of variables (based on work by serg)
  - print complaints about incorrect values for variables (truncation etc.,
    by requestion of consulting)
  - if no lower maximum is specified in variable definition, bound unsigned
    values at their maximum to prevent wrap-around
  - some calls to error_reporter had a \n, some didn't. remove \n from calls,
    let reporter-function handle it, so the default reporter behaves like that
    in mysqld
sql/mysql_priv.h:
  correct RANGE_ALLOC_BLOCK_SIZE (cleared with monty)
sql/mysqld.cc:
  correct maxima to correct data-type.
  correct minima where higher than default.
  correct range-alloc-block-size.
  correct inno variables so GET_* corresponds to actual variable's type.
sql/set_var.cc:
  When the new value for a variable is out of bounds, we'll send the
  client a warning (but not if the value was simply not a multiple of
  'blocksize').  sys_var_thd_ulong had this, sys_var_long_ptr_global
  didn't; broken out and streamlined to avoid duplication of code.
strings/llstr.c:
  ullstr() - the unsigned brother of llstr()
2007-11-30 06:32:04 +01:00
unknown
975731aa32 Eliminate 'unused variable' warnings when compiling non-debug build 2007-11-16 14:56:37 -07:00
unknown
e3c7265135 Merge trift2.:/MySQL/M50/mysql-5.0
into  trift2.:/MySQL/M50/push-5.0


include/my_sys.h:
  Auto merged
2007-11-14 15:26:38 +01:00