Commit graph

62545 commits

Author SHA1 Message Date
Omer BarNir
fb47b30384 Updates to README file of the 'engines' test suites 2010-05-04 14:24:36 -07:00
Georgi Kodinov
71b453fa06 Bug #53371: COM_FIELD_LIST can be abused to bypass table level grants.
This is the 5.1 merge and extension of the fix.
The server was happily accepting paths in table name in all places a table
name is accepted (e.g. a SELECT). This allowed all users that have some 
privilege over some database to read all tables in all databases in all
mysql server instances that the server file system has access to.
Fixed by :
1. making sure no path elements are allowed in quoted table name when
constructing the path (note that the path symbols are still valid in table names
when they're properly escaped by the server).
2. checking the #mysql50# prefixed names the same way they're checked for
path elements in mysql-5.0.
2010-05-04 17:03:28 +03: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
Georgi Kodinov
e038b56dab merged 5.1-innodb 2010-05-01 19:12:12 +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
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
Marko Mäkelä
b7a6240c41 Adjust tests for the Bug #50495 fix. 2010-04-21 12:40:32 +03:00
Marko Mäkelä
37062fc62f rec_convert_dtuple_to_rec(): Correct the debug check.
The "extern" accessor functions return zero or nonzero, not 0 or 1.
2010-04-21 12:16:11 +03:00
Marko Mäkelä
1ed5fab27b rec_convert_dtuple_to_rec(): Add a debug check. 2010-04-21 09:39:16 +03:00
Marko Makela
0aba4871c9 btr_cur_optimistic_insert(): Remove unused variable "heap". 2010-04-20 23:15:50 +03:00
Marko Makela
bac9559ecf dict_create_index_step(): Invoke dict_index_add_to_cache()
in strict mode only if innodb_strict_mode is set. (Bug #50495)

trx_is_strict(): New function, for checking innodb_strict_mode.
2010-04-20 14:42:22 +03:00
Marko Mäkelä
3b7ff90d7e Implement UNIV_BTR_AVOID_COPY, an optimization of page splits. 2010-04-20 11:29:08 +03:00
Marko =?ISO-8859-1?Q?M=E4kel=E4?=
ca85feba83 Enable UNIV_DEBUG_VALGRIND when HAVE_purify is set. 2010-04-19 13:36:03 +03:00
Marko =?ISO-8859-1?Q?M=E4kel=E4?=
6f58f36846 Enable innodb_plugin tests based on the presence of lib_innodb_plugin. 2010-04-19 12:44:05 +03:00
Marko =?ISO-8859-1?Q?M=E4kel=E4?=
68fcbba604 Do not require innodb for running innodb_plugin tests. 2010-04-19 12:21:13 +03:00