Commit graph

76699 commits

Author SHA1 Message Date
Tor Didriksen
8cd6099371 Bug#15960005 VALGRIND WARNINGS IN PROCESS_ARGS
Both <width> and <precision> can be specified as numbers or '*'.
  If an asterisk is used, an argument of type int is consumed.
2012-12-10 09:55:08 +01:00
Bill Qu
c3e918ea90 Approved by Jimmy and Inaam. rb#1576 2012-12-17 23:13:46 +08:00
Ramil Kalimullin
5c8cfd717e Auto-merge from mysql-5.1. 2012-12-14 14:01:43 +04:00
Inaam Rana
7d9836f76e merge from 5.1 2012-12-14 11:29:07 +05:00
Ravinder Thakur
e604bb8a03 Merging from 5.1 to 5.5 for bug#11761752 2012-12-13 20:58:09 +05:30
Marko Mäkelä
c85f51f92a Follow-up fix to Bug#14628410: Remove the Windows InnoDB Plugin specific
implementation of innobase_mysql_tmpfile() from MySQL 5.5 onwards.
2012-12-13 17:12:21 +02:00
Satya Bodapati
bf42e842e5 Merge fix for Bug#14628410 from mysql-5.1 to mysql-5.5 2012-12-13 18:56:47 +05:30
Harin Vadodaria
ff73218be4 Bug#15965288: BUFFER OVERFLOW IN YASSL FUNCTION
DOPROCESSREPLY()

Description: Merge from 5.1 to 5.5
2012-12-13 10:19:14 +05:30
Nirbhay Choubey
fc311cc623 Bug#13639125 DELIMITER STRIPS THE NEXT NEW LINE
IN A SQL STATEMENT

While processing each lines entered at the prompt,
mysql client appends a '\n' to all the lines except
for delimiter commands. However the same logic must
not apply if 'delimiter' is part of a string or a
comment, for which a '\n' should be added.

Fixed by adding appropriate checks.

Added a test case.
2012-12-12 22:31:03 +05:30
unknown
e10d25ef8f upmerge 14737171 5.1=>5.5 2012-12-12 15:10:47 +05:30
Dmitry Lenev
4235e46ea2 Bug #15954872 "MAKE MDL SUBSYSTEM AND TABLE DEFINITION CACHE
ROBUST AGAINST BUGS IN CALLERS".

Both MDL subsystems and Table Definition Cache code assume
that callers ensure that names of objects passed to them are
not longer than NAME_LEN bytes. Unfortunately due to bugs in
callers this assumption might be broken in some cases. As
result we get nasty bugs causing buffer overruns when we
construct MDL key or TDC key from object names.

This patch makes MDL and TDC code more robust against such
bugs by ensuring that we always checking size of result
buffer when constructing MDL and TDC keys. This doesn't
free its callers from ensuring that both db and table names
are shorter than NAME_LEN bytes. But at least these steps
prevents buffer overruns in case of bug in caller, replacing
them with less harmful behavior.

This is 5.5-only version of patch.

Changed code of MDL_key::mdl_key_init() to take into account
size of buffer for the key.

Introduced new version of create_table_def_key() helper function
which constructs TDC key without risk of result buffer overrun.
Places in code that construct TDC keys were changed to use this
function.

Also changed rm_temporary_table() and open_new_frm() functions
to avoid use of "unsafe" strmov() and strxmov() functions and
use safer strnxmov() instead.
2012-12-11 22:04:30 +04:00
unknown
897f497f74 upmerge 14737171 5.1 => 5.5 2012-12-11 18:35:52 +05:30
Joerg Bruehe
8c7308108d Merge ULN RPM stuff to main branch. 2012-12-11 11:30:58 +01:00
Annamalai Gurusami
2f7295575d Merging from mysql-5.1 to mysql-5.5. 2012-12-11 10:51:24 +05:30
Joerg Bruehe
0a925f7317 RPMs for ULN do not build in MySQL 5.6: Patches + libmysqld.so
Bug #15972480

This is the change for 5.5:
    a cleanup in the way "libmysqld.so" is created.
(Patches were adapted for 5.5 previously.)

Originally, the ".so" was created by taking all modules in
"libmysqld.a", after removing some few which caused unresolved
references.
This is no good idea, rather "ld" should be used to follow all
references from some few start modules.

At the same time, the ".so" version needed to be corrected:
The original "0.0.1" is both wrong and risky.
Rather, the server version is used to identify the ".so" file,
but for linkage the first two levels are sufficient (so upgrades
are possible without re-building the embedded application).
2012-12-10 09:42:18 +01:00
Dmitry Lenev
14ba37f76f Bug #15954896 "SP, MULTI-TABLE DELETE AND LONG ALIAS".
Using too long table aliases in stored routines might
have caused server crashes.

Code in sp_head::merge_table_list() which is responsible
for collecting information about tables used in stored
routine was not aware of the fact that table alias might
have arbitrary length. I.e. it assumed that table alias
can't be longer than NAME_LEN bytes and allocated buffer
for a key identifying table accordingly.

This patch fixes the issue by ensuring that we use
dynamically allocated buffer for table key when table
alias is too long. By default stack based buffer is used
in which NAME_LEN bytes are reserved for table alias.
2012-12-10 10:06:37 +04:00
Shivji Kumar Jha
07a5b266fb BUG#12359942 - REPLICATION TEST FROM ENGINE SUITE RPL_ROW_UNTIL TIMES OUT
patch to fix post push falures in pb2
             bzr merge 5.1->5.5

BUG#15872504 - REMOVE MYSQL-TEST/INCLUDE/GET_BINLOG_DUMP_THREAD_ID.INC
             bzr merge 5.1->5.6
2012-12-09 17:26:44 +05:30
Shivji Kumar Jha
6b3dad83c9 BUG#12359942 - REPLICATION TEST FROM ENGINE SUITE PL_ROW_UNTIL TIMES OUT
patch to fix post push falures in pb2 

BUG#15872504 - REMOVE MYSQL-TEST/INCLUDE/GET_BINLOG_DUMP_THREAD_ID.INC
            
=== Problem ===
            
The file named "mysql-test/include/get_binlog_dump_thread_id.inc" is not 
used anywhere. In any case, this file does wrong things in the wrong way:
1) The file seems to assume there is only one dump thread, but there may 
   be many.
2) you can get this information in a much easier way using the command:
   "select thread_id from threads where processlist_command="Binlog Dump";"

=== Fix ===
          
removed file 'mysql-test/include/get_binlog_dump_thread_id.inc'
2012-12-09 17:21:51 +05:30
Shivji Kumar Jha
51d43baa66 BUG#12359942 - REPLICATION TEST FROM ENGINE SUITE
RPL_ROW_UNTIL TIMES OUT
 
 patch to fix post push falures in pb2 

mysql-test/suite/rpl/r/rpl_row_until.result:
  changes to account for the changes made in
  corresponding test file.
mysql-test/suite/rpl/t/disabled.def:
  disabled test in macosx
mysql-test/suite/rpl/t/rpl_row_until.test:
  replaced static relayy log file by an mtr variable
  which saves the name of relay log file.
2012-12-09 15:50:32 +05:30
unknown
e06cd80415 2012-12-07 19:10:20 +05:30
Akhila Maddukuri
b74a229c23 Bug #15930494 MYSQLDUMP TEST SOMETIMES FAILS DUE TO MIXING STDOUT AND
STDERR

      Fix: Added a destination file to mysqldump.
2012-12-07 18:26:02 +05:30
unknown
b3b59f75d2 2012-12-07 15:41:49 +05:30
Joerg Bruehe
d07b5f1ca2 Last-minute fix to 5.1.67,
taking a change done to main 5.1 by Dmitri Lenev.

This is the original comment:

> committer: Dmitry Lenev <Dmitry.Lenev@oracle.com>
> branch nick: mysql-5.1-15954896
> timestamp: Wed 2012-12-05 19:26:56 +0400
> message:
>   Bug #15954896 "SP, MULTI-TABLE DELETE AND LONG ALIAS".

  Using too long table aliases in stored routines might
  have caused server crashes.

  Code in sp_head::merge_table_list() which is responsible
  for collecting information about tables used in stored
  routine was not aware of the fact that table alias might
  have arbitrary length. I.e. it assumed that table alias
  can't be longer than NAME_LEN bytes and allocated buffer
  for a key identifying table accordingly.

  This patch fixes the issue by ensuring that we use
  dynamically allocated buffer for table key when table
  alias is too long. By default stack based buffer is used
  in which NAME_LEN bytes are reserved for table alias.
2012-12-07 10:47:57 +01:00
Sergei Golubchik
852726038f typo 2012-12-06 17:30:22 +01:00
Sergei Golubchik
63e92a2b6c if the debian package name for 5.5.28 is 5.5.28-mariadb1~wheezy
then for 5.5.28a it should be
5.5.28a-mariadb1~wheezy not 5.5.28-mariadb-a1~wheezy
2012-12-06 16:34:02 +01:00
unknown
a8bad7d900 MDEV-3902 Assertion `record_length == m_record_length' failed at Filesort_buffer::alloc_sort_buffer
This bug is a duplicate of mdev-3899 so adding a test case only.
2012-12-21 11:18:29 +02:00
Vladislav Vaintroub
21b4fda3a5 MDEV-3945 - do not hold LOCK_thread_count when freeing THD.
The patch decreases the duration of LOCK_thread_count, so it is not hold during THD destructor and freeing memory.
This mutex  now only protects the integrity of threads list, when removing THD from it,  and thread_count variable.
  
The add_to_status() function that updates global status during client disconnect,  is now correctly protected by the LOCK_status mutex.

Benchmark : in a  "non-persistent" sysbench test (oltp_ro with reconnect after each query),  ~ 25% more connects/disconnects were measured
2012-12-21 00:12:37 +01:00
unknown
1b2692d0e9 MDEV-3899 Valgrind warnings (blocks are definitely lost) in filesort on IN subquery with SUM and DISTINCT
Analysys:
In the beginning of JOIN::cleanup there is code that is supposed to
free all filesort buffers. The code assumes that the table being sorted
is the first non-constant table. To get this table it calls:
first_top_level_tab(this, WITHOUT_CONST_TABLES)
  
However, first_top_level_tab() instead returned the wrong table - the first
one in the plan, instead of the first non-constant table. There is no other
place outside filesort() where sort buffers may be freed. As a result, the
sort buffer was not freed, and there was a memory leak.
  
Solution:
Change first_top_level_tab(), to test for WITH_CONST_TABLES instead of
WITHOUT_CONST_TABLES.
2012-12-20 22:38:40 +02:00
Michael Widenius
35b6020835 Fixed some compiler warnings
client/mysqldump.c:
  Removed compiler warning
extra/yassl/taocrypt/include/pwdbased.hpp:
  Removed compiler warning (iterations is always unsigned)
support-files/compiler_warnings.supp:
  Ignore warnings from groff
2012-12-19 21:58:05 +02:00
unknown
fef08da3e7 MDEV-3818: Query against view over IS tables worse than equivalent query without view
Fixed the test to be lower-case because it fails on windows with mixed case.
2012-12-18 12:44:15 +02:00
Michael Widenius
2dbce3d089 Fixed the CREATE TABLE IF EXIST generates warnings instead of errors
mysql-test/r/create.result:
  Updated test results
mysql-test/t/create.test:
  Updated test
sql/sql_base.cc:
  Use push_internal_handler/pop_internal_handler to avoid errors & warnings instead of clear_error
  Give a warnings instead of an error for CREATE TABLE IF EXISTS
sql/sql_parse.cc:
  Check if we failed because of table exists (can only happen from create)
sql/sql_table.cc:
  Check if we failed because of table exists (can only happen from create)
2012-12-17 22:34:56 +02:00
unknown
d7a0148758 MDEV-3818: Query against view over IS tables worse than equivalent query without view
Analysis:
The reason for the suboptimal plan when querying IS tables through a view
was that the view columns that participate in an equality are wrapped by
an Item_direct_view_ref and were not recognized as being direct column
references.

Solution:
Use the original Item_field objects via the real_item() method.
2012-12-17 15:23:58 +02:00
Michael Widenius
a334e87d65 Remember original table row pack type for ALTER TABLE if table is not copied. 2012-12-16 20:51:48 +02:00
Michael Widenius
b31909ffbb Removed lock wait timeout warning when using CREATE TABLE IF EXISTS
mysql-test/r/create.result:
  Added test case to show that CREATE TABLE also is not waiting if table exists.
mysql-test/t/create.test:
  Added test case to show that CREATE TABLE also is not waiting if table exists.
sql/sql_base.cc:
  Clear also warnings from acquire_locks if we retry.
2012-12-16 20:49:57 +02:00
Michael Widenius
33f3a11e2d Implemented MDEV-3941: CREATE TABLE xxx IF NOT EXISTS should not block if table exists.
- Added option to check_if_table_exists() to quickly check if table exists (either SHARE or .FRM)
- Extended lock_table_names() to not wait for meta data locks if CREATE IF NOT EXISTS is used.

mysql-test/r/create.result:
  New test case
mysql-test/t/create.test:
  New test case
sql/sql_base.cc:
  Added option to check_if_table_exists() to quickly check if table exists (either SHARE or .FRM)
  Extended lock_table_names() to not wait for meta data locks if CREATE IF NOT EXISTS is used.
sql/sql_base.h:
  Updated prototype
sql/sql_db.cc:
  Added extra argument to call to check_if_table_exists()
2012-12-16 16:13:17 +02:00
Michael Widenius
a6a8f12fa3 Automatic merge 2012-12-16 12:04:26 +02:00
Michael Widenius
4ba960569b Removed extra '+' from some lines (remains of old merge) 2012-12-14 20:21:50 +02:00
Harin Vadodaria
d8876ff2fb Bug#15912213: BUFFER OVERFLOW IN ACL_GET()
Description: A very large database name causes buffer
             overflow in functions acl_get() and
             check_grant_db() in sql_acl.cc. It happens
             due to an unguarded string copy operation.
             This puts required sanity checks before
             copying db string to destination buffer.
2012-12-06 17:02:09 +05:30
Harin Vadodaria
aec9ca5da4 Bug#15912213: BUFFER OVERFLOW IN ACL_GET()
Description: A very large database name causes buffer
             overflow in functions acl_get() and
             check_grant_db() in sql_acl.cc. It happens
             due to an unguarded string copy operation.
             This puts required sanity checks before
             copying db string to destination buffer.
2012-12-06 16:53:02 +05:30
Dmitry Shulga
54769c281e This patch fixes bug#14729757 - MY_HASH_SEARCH(&XID_CACHE,
XID_STATE->XID.KEY(),
                                XID_STATE->XID.KEY_LENGTH())==0
  
This bug is a regression of bug#11759534 - 51855: RACE CONDITION
                                           IN XA START.
  
The reason for regression is that the changes that fixes the original
bug wasn't merged from mysql-5.1 into mysql-5.5 and mysql-trunk.
Only null-merge was done for the patch changeset.
  
To incorporate lost changes the manual merge have been done.
  
Additionally the call of trans_rolback() was added into trans_xa_start()
in case if xid_cache_insert is failed() after transaction has been started.
If we don't call trans_rollback() we would never reset the flag
SERVER_STATUS_IN_TRANS in THD::server_status and therefore all subsequent
attempts to execute XA START in the connection where the error was occurred
will be failed since thd->in_active_multi_stmt_transaction() will return
the true every time when trans_xa_start is called.
  
The latest changes were absent in patch for mysql-5.1
2012-12-06 15:59:15 +06:00
Vladislav Vaintroub
c4b35f9279 MDEV-3918: myisamchk bogus error for files larger than 4GB.
The failure is caused by failing stat() call . C Runtime function stat() uses old struct with 32bit st_size member,
and since Visual Studio 2010 , it returns an error on st_size overflow (i.e on files larger than 4GB)

Fix replaces stat() by my_stat(), the later is backed by 64bit-able stat64().
2012-12-06 00:37:06 +01:00
unknown
0aad592f49 MDEV-3914 fix.
Fixed algorithm of detecting of first real table in view/subquery-in-the-FROM-clase.
2012-12-05 21:06:00 +02:00
Gleb Shchepa
e5424d196b Bug #15948123: SERVER WORKS INCORRECT WITH LONG TABLE ALIASES
After-push cleanup: removal of unneeded assertions.
2012-12-05 20:47:21 +04:00
Gleb Shchepa
46cfbf35f8 Bug #15948123: SERVER WORKS INCORRECT WITH LONG TABLE ALIASES
Post-push cleanup: removal of unneeded assertions.
2012-12-05 20:41:29 +04:00
Dmitry Lenev
db2a045f0e Merged fix for bug #15954896 "SP, MULTI-TABLE DELETE AND LONG ALIAS"
into 5.5 tree.
2012-12-05 19:50:02 +04:00
Dmitry Lenev
095e8271b7 Bug #15954896 "SP, MULTI-TABLE DELETE AND LONG ALIAS".
Using too long table aliases in stored routines might
have caused server crashes.

Code in sp_head::merge_table_list() which is responsible 
for collecting information about tables used in stored
routine was not aware of the fact that table alias might
have arbitrary length. I.e. it assumed that table alias
can't be longer than NAME_LEN bytes and allocated buffer
for a key identifying table accordingly.

This patch fixes the issue by ensuring that we use
dynamically allocated buffer for table key when table
alias is too long. By default stack based buffer is used
in which NAME_LEN bytes are reserved for table alias.
2012-12-05 19:26:56 +04:00
unknown
2c64d0a58d 2012-12-05 16:16:32 +01:00
Bjorn Munch
997748e850 Remove moot --unit-test option for mtr in collections 2012-12-05 15:14:08 +01:00
Gleb Shchepa
d538d394b8 Bug #15948123: SERVER WORKS INCORRECT WITH LONG TABLE ALIASES
Code in MDL subsystem assumes that identifiers of objects can't
be longer than NAME_LEN characters. This assumption was broken
when one tried to construct MDL_key based on table alias, which
can have arbitrary length. Since MDL_key's (and MDL locks) are
not really used for table aliases this patch changes code to
not initialize MDL_key object for table list element representing
aliases.
2012-12-05 17:24:45 +04:00
Gleb Shchepa
70cb820e2d Bug #15948123: SERVER WORKS INCORRECT WITH LONG TABLE ALIASES
Code in MDL subsystem assumes that identifiers of objects can't
be longer than NAME_LEN characters. This assumption was broken
when one tried to construct MDL_key based on table alias, which
can have arbitrary length. Since MDL_key's (and MDL locks) are
not really used for table aliases this patch changes code to
not initialize MDL_key object for table list element representing
aliases.
2012-12-05 16:53:33 +04:00