Commit graph

69380 commits

Author SHA1 Message Date
Alexander Nozdrin
da96e91524 A patch for Bug#12429877: QUERY_TABLES_LIST::SROUTINES IS NOT
FREED IN FLUSH_READ_LOCK (VALGRIND WARNING).

The problem was that under some circustances the memory allocated
for Query_tables_list::sroutines was not freed properly.
The cause of this problem was the absence of
LEX::restore_backup_query_tables_list() call in one of the branches
in mysql_table_grant() function.
2011-05-16 12:50:42 +04:00
Vinay Fisrekar
0c1e38b371 Merge from mysql-5.1 to mysql-5.5 2011-05-14 21:56:49 +05:30
Vinay Fisrekar
4731736320 Adding bug scenario for data types in main suite
Impementing Test Review Comment.
      
Bug test scenario:      
SELECT is not returning result set for "equal" (=) and "NULL safe equal
operator"  (<=>) on BIT data type. Extending this scenario for all data types
2011-05-14 21:44:49 +05:30
Marc Alff
4075c52b69 Bug#12552516 LF_HASH REQUIRES MY_THREAD_INIT()
Before this fix, a thread instrumented for the performance schema,
that would perform file io operations, could crash inside the LF_HASH
implementation, in cases when my_thread_init is not called.

The crash itself has not been reported in 5.5 but similar crashes have
been found in 5.6-based development branches, using LF_HASH for
more instrumentation.

The possibility of a crash in 5.5 is confirmed by code analysis.

The problem is that, when my_thread_init() is not called,
which can happen for threads in storage engines or thirs party code,
my_thread_var is NULL.

Using my_thread_var->stacks_ends_here in mysys/lf_alloc-pin.c is unsafe.

Given that my_thread_var is used:
- only for stacks_ends_here
- only on platform with HAVE_ALLOCA
- only when there is enough room on the stack
and given that the LF_HASH implementation has a fallback
algorythm implemented already when using alloca is not possible,
using my_thread_var->stacks_ends_here is in fact not a strict requirement,
and can be relaxed.

The fix is to:
- test explicitly if my_thread_var is NULL, to account for cases
  when my_thread_init() is not used by the calling thread.
- not use alloca in this case, and rely on the fall back code already in place.
  so that the LF_HASH can be supported even without my_thread_init().

The implementation of mysys/lf_alloc-pin.c has been fixed to support this new usage.
The units tests in unittest/mysys/lf-t.c have been adjusted accordingly.
2011-05-13 18:04:49 +02:00
Mikael Ronstrom
419e584bc6 Removed variables no longer needed in plugins, moved to methods instead 2011-05-13 15:46:35 +02:00
Mikael Ronström
ecb3814be8 merge 2011-05-13 13:19:38 +02:00
Bjorn Munch
0b9682a0ae null upmerge 2011-05-13 13:04:49 +02:00
Bjorn Munch
db4ed17587 merge from 5.1-mtr 2011-05-13 13:04:01 +02:00
Bjorn Munch
0fb541fbb9 merge from 5.5-mtr 2011-05-13 13:02:42 +02:00
MySQL Build Team
33b015f30b changed the VERSION tag to 14 2011-05-13 07:00:09 +02:00
chuck.bell@oracle.com
44b2df4aba BUG#12549572 : CMake file does not include gcov option
This patch inserts an 'ENABLE_GCOV' option for enabling gcov compilation
on Linux machines. It modifies the CMakeLists.txt setting this option
to 'OFF' by default.

Note: The option requires a debug build. For example, 
      -DCMAKE_BUILD_TYPE:string="Debug"
2011-05-12 18:22:14 -04:00
Mikael Ronström
06087d2315 merge 2011-05-12 20:35:31 +02:00
Bjorn Munch
e484f38435 null upmerge 2011-05-12 15:23:17 +02:00
Bjorn Munch
11a509bedf null upmerge 2011-05-12 15:22:10 +02:00
Bjorn Munch
aa8715e15e merge from 5.5 main 2011-05-12 15:19:59 +02:00
Jon Olav Hauglid
7577c115a0 Bug#12346411 SQL/LOG.CC:6509: ASSERTION `PREPARED_XIDS > 0' FAILED
This assert could be triggered during two phase commit if binary
log was used as transaction coordinator log. The triggered assert
checks that the same number of transaction IDs are processed in
the prepare and commit phases.

The reason it was triggered, was that the transaction consisted
of an INSERT/UPDATE IGNORE that had an ignorable error. Since it
had an error, no row log events were made and therefore
prepared_xids was 0. However, since it was an IGNORE statement,
the statement started a read/write statement transaction, committed
it and completed successfully.

This patch fixes the problem by adjusting the assert to take
this possibility into account.

Test case added to binlog.binlog_innodb_row.test.
2011-05-12 14:56:00 +02:00
Tatjana Azundris Nuernberg
e72473450e auto-merge 2011-05-12 13:38:14 +01:00
Mikael Ronström
69396894f1 merge 2011-05-12 14:29:32 +02:00
Bjorn Munch
dca22eb6f3 merge from 5.1 main 2011-05-12 14:08:47 +02:00
Tatjana Azundris Nuernberg
f1bad788e5 auto-merge 2011-05-12 10:41:17 +01:00
Tatjana Azundris Nuernberg
614f05e4ca auto-merge 2011-05-12 06:23:16 +01:00
Tatjana Azundris Nuernberg
6fb68a22bd Bug#11902767/Bug#60580: Statement improperly replicated crashes slave SQL thread
If LOAD DATA INFILE featured a SET clause, the name=value pairs
would be regenerated using item::print. Unfortunately, that code
is mostly optimized for EXPLAIN EXTENDED output and such, and can
not be relied on to return valid SQL.

We now name each value its original, user-supplied form and use
that to create LOAD DATA INFILE statements for statement-based
replication.
2011-05-12 05:56:41 +01:00
Tatjana Azundris Nuernberg
25abeed586 auto-merge 2011-05-12 05:43:53 +01:00
Tatjana Azundris Nuernberg
79c1c8e586 auto-merge 2011-05-12 05:32:06 +01:00
Tatjana Azundris Nuernberg
a0f300a6d3 auto-merge Bug#11762799/Bug#55436 2011-05-12 04:05:12 +01:00
Tatjana Azundris Nuernberg
2683078d28 auto-merge Bug#11762799/Bug#55436 2011-05-12 03:41:51 +01:00
Luis Soares
efc20dca00 BUG#12416700
Automerged bzr bundle from bug report into latest mysql-5.5.
2011-05-11 15:16:17 +01:00
Magnus Blåudd
d8a9b36b9d Merge bug 12384993 2011-05-11 15:15:11 +02:00
Alexander Nozdrin
cbf455cf87 Ignore auto-generated files. 2011-05-11 16:45:57 +04:00
Georgi Kodinov
621dc09548 merge from mysql-5.5 2011-05-11 15:34:15 +03:00
MySQL Build Team
94f424652c Cloning of the 5.5.13 release from Mysql-5.5,
increase the version number by two
2011-05-11 13:40:29 +02:00
Georgi Kodinov
a914a32191 Bug #11744875: 4082: integer lengths cause truncation with distinct concat
and innodb

The 5.5 version of the patch.

The server doesn't restrict the data that can be inserted into integer columns 
with explicitly specified length that's smaller than what the type can handle,
e.g. 1234 can be inserted into an INT(2) column just fine.
Thus, when calcualting the maximum width of expressions involving such 
restricted integer columns we need to use the implicit maximum width of 
the field instead of the explicitly speficied one.
Fixed the server to use the implicit maximum in such cases and made sure 
the implicit maximum is addjusted the same way as the explicit one wrt
signedness.

Fixed several test case results (ctype_*.result, metadata.result and 
type_ranges.result) to reflect the extended column widths.

Added a regression test case in distinct.test.

Note : this is the behavior preserving fix that makes 5.5 behave as 5.1 and 
earlier. In the mysql trunk we'll add a insert time check for the explict 
maximum size.
2011-05-11 14:11:57 +03:00
Magnus Blåudd
f8e86f50e2 Bug#12384993 EXTRA/RPL_TEST/CHECK_TYPE.INC NEED SUPPORT FOR SPECIFIC ENGINE
- add support for choosing the engine of test
    table(t1) with $engine_type
 - add primary key to the test table(t1) to support
   replication of BLOB/TEXT (also with ENGINE=ndb)
 - change the suppression since the warning printed to error log
  now says "Column 1"
2011-05-11 09:49:23 +02:00
Serge Kozlov
f978c103bb automerge 2011-05-10 17:50:30 +04:00
Georgi Kodinov
2b9c0451f7 weave null merge mysql-5.1->mysql-5.5 2011-05-10 16:24:34 +03:00
Georgi Kodinov
ef2d701c00 weave merge mysql-5.0->mysql-5.1 2011-05-10 16:21:44 +03:00
Vasil Dimov
3ce0f809c3 Null merge mysql-5.1-innodb -> mysql-5.5-innodb
(the change is irrelevant in 5.5)
2011-05-10 15:50:53 +03:00
Vasil Dimov
6209f47fd2 Increment InnoDB Plugin version from 1.0.16 to 1.0.17.
InnoDB Plugin 1.0.16 has been released with MySQL 5.1.57.
2011-05-10 15:43:30 +03:00
Luis Soares
c9eef1d74a BUG#12416700: RPL_SHOW_SLAVE_HOSTS FAILS SPORADICALLY (TIMEOUT
IN WAIT_SHOW_CONDITION) 

There was a typo in the name of one of the parameters to the
include file wait_show_condition. The parameter name was being
set to "connection" instead of "condition".

We fix this typo, improve one instruction in the test case and
deploy parameter checks inside wait_show_condition.inc.
2011-05-10 12:41:09 +01:00
Serge Kozlov
4dde684315 automerge 5.1->5.5 2011-05-09 23:26:41 +04:00
Serge Kozlov
e8b54a7ce9 WL#5867
Replaced the error code by error name
2011-05-09 23:14:24 +04:00
Bjorn Munch
5a75bb9f11 WL #5680 MTR results written to file with well defined format
Added --result-file option, which will produce var/mtr-results.txt
Output has a simple format:

<tag> : <value>  for general info on test run
{
  <tag> : <value>
  ....
}                for each test

Output from failed tests are included but may be truncated.
See WL for more details.
2011-05-09 16:07:43 +02:00
Alexander Nozdrin
75498ef924 Patch for Bug#12362125 (SP INOUT HANDLING IS BROKEN FOR TEXT TYPE).
Attempts to assign value to a table column from trigger by using
NEW.column_name pseudo-variable might result in garbled data.
That happened when:
  - the column had a BLOB-based type (e.g. TEXT)
    and
  - the value being assigned was retrieved from stored routine variable
    of the same type.

The problem was that BLOB values were not copied correctly in this
case. Instead of doing a copy of a real value, the value's representation
in record buffer was copied. This representation is essentially a
pointer to a buffer associated with the virtual table for routine
variables where the real value is stored. Since this buffer got
freed once trigger was left or could have changed its contents when
new value was assigned to corresponding routine variable such a shallow
copying resulted in garbled data in NEW.colum_name column.

It worked in 5.1 due to a subtle bug in create_virtual_tmp_table():
  - in 5.1 create_virtual_tmp_table() returned a table which
    had db_low_byte_first == false.
  - in 5.5 and up create_virtual_tmp_table() returns a table which
    has db_low_byte_first == true.
Actually, db_low_byte_first == false only for ISAM storage engine,
which was deprecated and removed in 5.0.

Having db_low_byte_first == false led to getting false in the
complex condition for the 2nd "if" in field_conv(), which in turn
led to copy-blob-behavior as a fall-back strategy:
  - to->table->s->db_low_byte_first was true (correct value)
  - from->table->s->db_low_byte_first was false (incorrect value)

In 5.5 and up that condition is true, which means blob-values are
not copied.
2011-05-09 12:29:23 +04:00
Marko Mäkelä
fd33784f71 A non-functional change related to Bug#11830883
page_rec_write_field(): Renamed from page_rec_write_index_page_no()
and inlined.
2011-05-09 11:12:26 +03:00
Alexander Nozdrin
cd501675d8 Patch for Bug#12374486 - SEVERE MEMORY LEAK IN PREPARED STATEMENTS
THAT CALL STORED PROCEDURES.

The bug was introduced by WL#4435. The problem was that if a stored
procedure generated a few result sets with different set of columns,
a new memory would be allocated after every EXECUTE for every
result set.

The fix is to introduce a new memory root in scope of MYSQL_STMT,
and to store result-set metadata in that memory root.
2011-05-06 17:39:20 +04:00
Alexander Nozdrin
bc4095643b Patch for Bug#11848763 / 60025
(SUBSTRING inside a stored function works too slow).

The user-visible problem was that the server started to consume memory if a
stored-routine of some sort is executed subsequently. The memory was freed
only after the corresponding connection was closed.

Technically, the problem was that the memory needed for temporary string
conversions was allocated on the connection ("persistent") memory root,
instead of statement one.

The root cause of this problem was the incorrect patch for Bug 55744.
That patch wrongly fixed a crash in prepared-statement-mode introduced by
another patch. The patch for Bug 55744 used wrong condition to check if
prepared statement mode is active (or whether the connection-scoped or
statement-scoped memory root should be used). The thing is that for
prepared statements such conversions should be done in the connection
memory root, so that that the transformations of item-tree were correctly
remembered in the PREPARE-phase.

The fix is to use proper condition to detect prepared-statement-mode and
use proper memory root.
2011-05-06 15:41:24 +04:00
Alexander Nozdrin
2593b14ccb Preliminary patch for Bug#11848763 / 60025
(SUBSTRING inside a stored function works too slow).

Background:
  - THD classes derives from Query_arena, thus inherits the 'state'
    attribute and related operations (is_stmt_prepare() & co).

  - Although these operations are available in THD, they must not
    be used. THD has its own attribute to point to the active
    Query_arena -- stmt_arena.

  - So, instead of using thd->is_stmt_prepare(),
    thd->stmt_arena->is_stmt_prepare() must be used. This was the root
    cause of Bug 60025.

This patch enforces the proper way of calling those operations.
is_stmt_prepare() & co are declared as private operations
in THD (thus, they are hidden from being called on THD instance).

The patch tries to minimize changes in 5.5.
2011-05-06 15:39:40 +04:00
Magnus Blåudd
b1ff2e6813 Add --with-debug=full support to BUILD/* scripts, this option has been lost
between 5.1 and 5.5, it's purpose is to set the compiler flags in a way that
does not optimize away the call stack(i.e don't use any -OX flags at all)
2011-05-06 11:20:01 +02:00
Magnus Blåudd
ec425cc5ac Merge in patch for bug 12380149 2011-05-06 10:53:42 +02:00
Sunanda Menon
78e73ec219 Merge from mysql-5.0.93-release 2011-05-06 10:36:30 +02:00