Commit graph

62760 commits

Author SHA1 Message Date
Marko Mäkelä
6e5619be2c Add Valgrind checks to catch uninitialized writes to data files.
buf_flush_insert_into_flush_list(),
buf_flush_insert_sorted_into_flush_list(),
buf_flush_post_to_doublewrite_buf(): Check that the page is initialized.
2010-05-04 15:55:10 +03:00
Marko Mäkelä
19263724e4 Add Valgrind checks to catch uninitialized writes to data files.
buf_flush_insert_into_flush_list(),
buf_flush_insert_sorted_into_flush_list(),
buf_flush_post_to_doublewrite_buf(): Check that the page is initialized.
2010-05-04 15:47:44 +03:00
Mattias Jonsson
f33075fd16 merge 2010-05-04 14:26:44 +02:00
Marko Mäkelä
39be66c7ce Remove UNIV_BTR_AVOID_COPY. It was broken because btr_attach_half_pages()
would get the block, new_block in the wrong order.
Fixing that would have complicated the function even further
for this marginal case.
2010-05-04 13:55:46 +03:00
Alfranio Correia
3c30921662 BUG#43407 SET GLOBAL SQL_SLAVE_SKIP_COUNTER should log previous state in error log
When issuing a 'SET GLOBAL SQL_SLAVE_SKIP_COUNTER' statement, the previous
position along with the new position is dumped into the error log. Namely,
the following information is printed out: skip_counter, group_relay_log_name
and group_relay_log_pos.
2010-05-04 10:41:28 +01:00
Marko Mäkelä
4e76242675 btr_page_split_and_insert(): Correct the fix of Bug #52964.
When split_rec==NULL, choose the correct node pointer key (first_rec).
2010-05-04 12:31:28 +03:00
Alfranio Correia
819caf8eb8 BUG#43406 CHANGE MASTER TO should log previous state in error log
When issuing a 'CHANGE MASTER TO' statement, key elements of the previous
state, namely the host, port, the master_log_file and the master_log_pos
are dumped into the error log.
2010-05-04 10:17:20 +01:00
Kristofer Pettersson
95e712b0b7 Automerge 2010-05-03 19:21:09 +02:00
Kristofer Pettersson
5dd5d70506 Bug#50373 --secure-file-priv=""
Iterative patch improvement. Previously committed patch
caused wrong result on Windows. The previous patch also
broke secure_file_priv for symlinks since not all file
paths which must be compared against this variable are
normalized using the same norm.

The server variable opt_secure_file_priv wasn't
normalized properly and caused the operations
LOAD DATA INFILE .. INTO TABLE ..
and
SELECT load_file(..)
to do different interpretations of the 
--secure-file-priv option.
     
The patch moves code to the server initialization
routines so that the path always is normalized
once and only once.
      
It was also intended that setting the option
to an empty string should be equal to 
lifting all previously set restrictions. This
is also fixed by this patch.


mysql-test/r/loaddata.result:
  * Removed test code which will currently break the much used --mem feature of mtr.
mysql-test/t/loaddata.test:
  * Removed test code which will currently break the much used --mem feature of mtr.
sql/item_strfunc.cc:
  * Replaced string comparing code on opt_secure_file_priv with an interface which guarantees that both file paths are normalized using the same norm on all platforms.
sql/mysql_priv.h:
  * Added signature for is_secure_file_path()
sql/mysqld.cc:
  * New function for checking if a path compatible with the secure path restriction.
  * Added initialization of the opt_secure_file_priv variable.
sql/sql_class.cc:
  * Replaced string comparing code on opt_secure_file_priv with an interface which guarantees that both file paths are normalized using the same norm on all platforms.
sql/sql_load.cc:
  * Replaced string comparing code on opt_secure_file_priv with an interface which guarantees that both file paths are normalized using the same norm on all platforms.
2010-05-03 18:14:39 +02:00
Georgi Kodinov
f63608ea97 Bug #53371: COM_FIELD_LIST can be abused to bypass table level grants.
The server was not checking the supplied to COM_FIELD_LIST table name
for validity and compliance to acceptable table names standards.
Fixed by checking the table name for compliance similar to how it's 
normally checked by the parser and returning an error message if 
it's not compliant.
2010-05-03 18:16:51 +03:00
Marko Mäkelä
7c4e538d76 buf_zip_decompress(): Allow BUF_NO_CHECKSUM_MAGIC as the stamped checksum.
buf_page_get_gen(): Assert that buf_zip_decompress() succeeds.
Callers are not prepared for a NULL return value. (Bug #53248)
2010-05-03 15:28:59 +03:00
unknown
1f3305f695 Raise version number after cloning 5.0.91 2010-05-03 12:06:18 +02:00
Georgi Kodinov
e038b56dab merged 5.1-innodb 2010-05-01 19:12:12 +03:00
Georgi Kodinov
037950e676 tree name change 2010-05-01 16:46:04 +03:00
Alexey Kopytov
26570994b2 Automerge. 2010-04-30 15:27:17 +04:00
Alexey Kopytov
97374a1184 Bug #48419: another explain crash..
WHERE predicates containing references to empty tables in a
subquery were handled incorrectly by the optimizer when
executing EXPLAIN. As a result, the optimizer could try to
evaluate such predicates rather than just stop with
"Impossible WHERE noticed after reading const tables" as 
it would do in a non-subquery case. This led to valgrind 
errors and crashes.

Fixed the code checking the above condition so that subqueries
are not excluded and hence are handled in the same way as top
level SELECTs.

mysql-test/r/explain.result:
  Added a test case for bug #48419.
mysql-test/r/ps.result:
  Updated test results to take the new (and more correct)
  "Extra" comments in execution plans.
mysql-test/t/explain.test:
  Added a test case for bug #48419.
sql/sql_select.cc:
  There is no point in excluding subqueries from checking
  for identically false WHERE conditions.
2010-04-30 15:10:48 +04:00
Vasil Dimov
3bffc40a24 Disable innodb.innodb, main.ps_3innodb and main.partition_innodb_plugin
mysql-tests because those emit (spurious?) valgrind warnings.
2010-04-30 13:02:36 +03:00
Davi Arnaut
4e378bc55b Manual merge. 2010-04-29 20:18:19 -03:00
Marko Makela
c144a091db recv_sys_init(), recv_sys_empty_hash(): Shrink recv_sys->addr_hash.
This addresses Bug #53122 in the built-in InnoDB.
2010-04-29 15:41:47 +02:00
Marko Makela
f10cf42068 recv_sys_init(), recv_sys_empty_hash(): Shrink recv_sys->addr_hash.
recv_addr_t: Turn space,page_no into bitfields to save space on 64-bit.
This addresses Bug #53122 in the InnoDB Plugin.
2010-04-29 15:37:50 +02:00
Marko Makela
0ca989eaaf Reduce the next-key locking of READ UNCOMMITTED to match that of
READ COMMITTED in the built-in InnoDB. (Bug #48607)
2010-04-29 15:29:45 +02:00
Davi Arnaut
54705ab176 Bug#50974: Server keeps receiving big (> max_allowed_packet) packets indefinitely.
The server could be tricked to read packets indefinitely if it
received a packet larger than the maximum size of one packet.
This problem is aggravated by the fact that it can be triggered
before authentication.

The solution is to no skip big packets for non-authenticated
sessions. If a big packet is sent before a session is authen-
ticated, a error is returned and the connection is closed.

include/mysql_com.h:
  Add skip flag. Only used in server builds.
sql/net_serv.cc:
  Control whether big packets can be skipped.
2010-04-29 10:28:16 -03:00
Marko Makela
74ae1326c9 Reduce the next-key locking of READ UNCOMMITTED to match that of
READ COMMITTED in the InnoDB Plugin. (Bug #48607)
2010-04-29 15:27:43 +02:00
Ramil Kalimullin
0d5dbb166b Fix for bug #53237: mysql_list_fields/COM_FIELD_LIST stack smashing
Problem: "COM_FIELD_LIST is an old command of the MySQL server, before there was real move to only
SQL. Seems that the data sent to COM_FIELD_LIST( mysql_list_fields() function) is not
checked for sanity. By sending long data for the table a buffer is overflown, which can
be used deliberately to include code that harms".

Fix: check incoming data length.


sql/sql_parse.cc:
  Fix for bug #53237: mysql_list_fields/COM_FIELD_LIST stack smashing
    - check incoming mysql_list_fields() table name arg length.
2010-04-29 08:42:32 +04:00
Vasil Dimov
6fa8e485e5 Bug#53046 dict_update_statistics_low can still be run concurrently
on same table

Followup to vasil.dimov@oracle.com-20100428102033-dt3caf531rs3lidr :

Add more asserions, which I forgot.
2010-04-28 13:34:52 +03:00
Vasil Dimov
b7ef4f178d Revert the fix of Bug#38996 Race condition in ANALYZE TABLE
This is branches/zip@r6032 in SVN and _is part_ of
revid:svn-v4:16c675df-0fcb-4bc9-8058-dcc011a37293:branches/zip:6113
in BZR.

This is being reverted because now the code is serialized directly on
index->stat_n_diff_key_vals[] as the fix for
Bug#53046 dict_update_statistics_low can still be run concurrently on same table
goes.
2010-04-28 13:32:00 +03:00
Vasil Dimov
330f93bc11 Followup to vasil.dimov@oracle.com-20100428084627-wtrmc66wqvjsdgj7:
Address Marko's suggestions wrt the fix of
Bug#53046 dict_update_statistics_low can still be run concurrently
on same table
2010-04-28 13:20:33 +03:00
Vasil Dimov
2b57b0765d Fix Bug#53046 dict_update_statistics_low can still be run concurrently
on same table

Protect dict_index_t::stat_n_diff_key_vals[] with an array of
mutexes.

Testing: tested all code paths under UNIV_SYNC_DEBUG
for the one in dict_print() one has to enable the InnoDB table monitor:
CREATE TABLE innodb_table_monitor (a int) ENGINE=INNODB;
2010-04-28 11:46:27 +03:00
Marko Makela
91702fd313 Merge r6103 from InnoDB Plugin to the built-in InnoDB to fix Bug #53202:
------------------------------------------------------------------------
  r6103 | marko | 2009-10-26 15:46:18 +0200 (Mon, 26 Oct 2009) | 4 lines
  Changed paths:
     M /branches/zip/row/row0ins.c

  branches/zip: row_ins_alloc_sys_fields(): Zero out the system columns
  DB_TRX_ID, DB_ROLL_PTR and DB_ROW_ID, in order to avoid harmless
  Valgrind warnings about uninitialized data.  (The warnings were
  harmless, because the fields would be initialized at a later stage.)
  ------------------------------------------------------------------------
2010-04-28 08:33:25 +02:00
Vasil Dimov
814ac9a7ac Merge mysql-5.1 -> mysql-5.1-innodb, this merge does not change
any files.
2010-04-27 17:45:30 +03:00
Vasil Dimov
a1bdbe8a0c Do not define UNIV_DEBUG_VALGRIND when HAVE_purify because
this results in some valgrind errors.

Bug#53202 valgrind: uninitialized bytes in dtuple_print()
has been opened to track this.
2010-04-27 17:05:41 +03:00
Marko Mäkelä
c2735351b4 Merge 2010-04-27 16:51:54 +03:00
Marko Mäkelä
a5b4285132 row_merge_drop_temp_indexes(): Remove a bogus char-to-ulint cast. 2010-04-27 16:47:38 +03:00
Vasil Dimov
c5ca0da1e8 Merge 3417..3421 from mysql-5.1-innodb 2010-04-27 09:16:45 +03:00
Vasil Dimov
777c194cda Split the innodb.innodb mysql-test.
Extract part of innodb.innodb into innodb.innodb_misc1

This is needed in order to be able to more easily debug this test,
under valgrind, it is too huge.
2010-04-27 09:09:08 +03:00
Alexey Kopytov
6d43510a42 Backport of the fix for bug #50335 to 5.0.
The problem was in an incorrect debug assertion. The expression
used in the failing assertion states that when finding
references matching ORDER BY expressions, there can be only one
reference to a single table. But that does not make any sense,
all test cases for this bug are valid examples with multiple
identical WHERE expressions referencing the same table which
are also present in the ORDER BY list.

Fixed by removing the failing assertion. We also have to take
care of the 'found' counter so that we count multiple
references only once. We rely on this fact later in
eq_ref_table().

mysql-test/r/join.result:
  Added a test case for bug #50335.
mysql-test/t/join.test:
  Added a test case for bug #50335.
sql/sql_select.cc:
  Removing the assertion in eq_ref_table() as it does not make
  any sense. We also have to take care of the 'found' counter so
  that we count multiple references only once. We rely on this
  fact later in eq_ref_table().
2010-04-27 00:06:00 +04:00
Marko Mäkelä
4d646bd16e lock_rec_queue_validate(): Disable a bogus check that
a transaction that holds a lock on a clustered index record
also holds a lock on the secondary index record.
2010-04-26 16:10:29 +03:00
Marko Mäkelä
30d6298442 recv_sys_init(): Skip the red-black tree in Hot Backup. 2010-04-26 14:26:09 +03:00
Marko Mäkelä
bd4a354c29 Add a test case for Bug #52745. 2010-04-26 14:08:56 +03:00
Marko Mäkelä
507c96aa52 Merge Vasil Dimov 2010-04-26 Bump InnoDB Plugin version number after 1.0.7 2010-04-26 13:52:15 +03:00
Marko Mäkelä
063928ba05 row_search_for_mysql(): Never try semi-consistent read in unique searches.
They are only useful in table scans. (Bug #52663)
2010-04-26 13:27:25 +03:00
Vasil Dimov
f0e0c873e3 Bump InnoDB Plugin version number after 1.0.7 has been released
in MySQL 5.1.46.
2010-04-26 11:35:57 +03:00
Marko Mäkelä
410afeaa0b btr_page_split_and_insert(): Silence a compiler warning
about possibly uninitialized variable insert_left.
2010-04-26 10:39:49 +03:00
Calvin Sun
44bac2ea9c mysql-5.1-innodb: add error codes to innodb_bug51920.test
kill of active connection yields different error code
depending on platform.
2010-04-22 14:16:14 -05:00
Marko Mäkelä
e7c9998119 Correct the definition of DICT_SYS_INDEXES_NAME_FIELD.
When row_merge_drop_temp_indexes() was reworked to drop the indexes
via the data dictionary cache, the code was broken because it would
read the index name from the wrong field.
2010-04-22 12:33:42 +03:00
Marko Mäkelä
c24b497399 btr_page_split_and_insert(): Avoid an infinite loop. (Bug #52964)
btr_page_tuple_smaller(): New function, refactored from
btr_page_split_and_insert().

btr_page_get_split_rec(): Renamed from btr_page_get_sure_split_rec().
Note that a NULL return may mean that the tuple is to be inserted into
either the lower or upper page, to be determined by btr_page_tuple_smaller().

btr_page_split_and_insert(): When btr_page_get_split_rec() returns NULL,
invoke btr_page_tuple_smaller() to determine which half-page the tuple
belongs to.

Reviewed by Sunny Bains
2010-04-21 21:53:59 +03:00
Luis Soares
fbe81e3c97 BUG#52868: Wrong handling of NULL value during update, replication out
of sync

In RBR, sometimes the table->s->last_null_bit_pos can be zero. This
has impact at the slave when it compares records fetched from the
storage engine against records in the binary log event. If
last_null_bit_pos is zero the slave, while comparing in
log_event.cc:record_compare function, would set all bits in the last
null_byte to 1 (assumed all 8 were unused) . Thence it would loose the
ability to distinguish records that were similar in contents except
for the fact that some field was null in one record, but not in the
other. Ultimately this would cause wrong matches, and in the specific
case depicted in the bug report the same record would be updated
twice, resulting in a lost update.

Additionally, in the record_compare function the slave was setting the
X bit unconditionally. There are cases that the X bit does not exist
in the record header. This could also lead to wrong matches between
records.

We fix both by conditionally resetting the bits: (i) unused null_bits
are set if last_null_bit_pos > 0; (ii) X bit is set if
HA_OPTION_PACK_RECORD is in use.

mysql-test/extra/rpl_tests/rpl_record_compare.test:
  Shared part of the test case for MyISAM and InnoDB.
mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test:
  InnoDB test case.
mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test:
  MyISAM test case. Added also coverage for Field_bits case.
sql/log_event.cc:
  Deployed conditional setting of unused bits at record_compare.
sql/log_event_old.cc:
  Same change as in log_event.cc.
2010-04-21 13:47:55 +01:00
Marko Mäkelä
66e1700bed dict_create_index_step(): Be strict about DYNAMIC and COMPRESSED tables.
Bug #50495 is about REDUNDANT and COMPACT tables, after all.
2010-04-21 13:27:23 +03:00
Marko Mäkelä
8c65e887a0 ha_innobase::add_index(): Only check for duplicate indexes
when the data dictionary is locked.
This fixes a UNIV_DEBUG assertion failure in innodb-index.test.
2010-04-21 13:00:29 +03:00
Marko Mäkelä
8c828e3afd dtuple_convert_big_rec(): Store locally any fields whose maximum length
is less than 256 bytes. (Bug #52745)
Add related comments and debug assertions to the "offsets"
functions in rem0rec.c.
Approved by Sunny Bains
2010-04-21 12:50:33 +03:00