Commit graph

76829 commits

Author SHA1 Message Date
unknown
701419b02f Merge MariaDB 10.0-base to MariaDB 10.0 2012-12-18 15:01:58 +01:00
Sergei Golubchik
6a742fc3b1 MDEV-3927 Add variable "have yassl"
have_openssl variable was ON even when OpenSSL was not used (but YaSSL was).
fix that, so that have_openssl really corresponds to OpenSSL

rename not_openssl.inc to not_ssl.inc and fix the test accordingly.
2012-12-18 11:56:00 +01:00
Sergei Golubchik
6c3de76ad5 fix have_debug_sync.inc
remove unused require files
2012-12-17 21:00:36 +01:00
Sergei Golubchik
1d2b11b291 MDEV-438 Microseconds: Precision is ignored in CURRENT_TIMESTAMP(N) when it is given as a default column value
For MySQL 5.6 compatibility, support precision specification in CURRENT_TIMESTAMP in
a default clause, when it's not less than the column's precision.
2012-12-17 20:47:23 +01:00
Sergei Golubchik
cb7f5948ec simplify the handler api - table_type() is no longer abstract, not even virtual 2012-12-17 11:00:39 +01:00
Sergei Golubchik
a058974440 remove HAVE_EXPLICIT_TEMPLATE_INSTANTIATION 2012-12-17 10:56:26 +01:00
unknown
cd0970c480 MDEV-532: Fix some race conditions in test cases.
With MDEV-532, the binlog_checkpoint event is logged asynchronously
from a binlog background thread. This causes some sporadic failures
in some test cases whose output depends on order of events in
binlog.

Fix using an include file that waits until the binlog checkpoint
event has been logged before proceeding with the test case.
2012-12-17 12:49:11 +01:00
Igor Babaev
1b62f0f58c Merge maria-5.5-mwl248 -> 10.0-base. 2012-12-16 21:33:17 -08:00
Igor Babaev
7760efad74 Merge mariadb-5.5 -> 10.0-base. 2012-12-16 16:49:19 -08:00
Sergei Golubchik
4923d19b7c small code cleanup taken from MySQL 5.6 2012-12-16 21:45:45 +01:00
Sergei Golubchik
fe7c2aaeea MDEV-3816 init-file stops getting executed if a long enough line is encountered; on a debug version, assertion `! is_set() || can_overwrite_status' fails
backport improved bootstrap error handling from 5.6

Was:
  revno: 3768.1.1
  committer: Christopher Powers <chris.powers@oracle.com>
  timestamp: Wed 2012-05-02 22:16:40 -0500
  message:
    Bug#11766342 INITIAL DB CREATION FAILS ON WINDOWS WITH AN ASSERT IN SQL_ERROR.CC
    Improved bootstrap error handling:
    - Detect and report file i/o errors
    - Report query size errors with nearest query text
2012-12-16 21:11:24 +01:00
Sergei Golubchik
1679fe1c3e MDEV-3834 Crossgrade from MySQL 5.6.7 to MariaDB 10.0 fails due to non-existing mysql.host table
Treat the host table as optional, don't abort when it's missing
2012-12-15 21:55:04 +01:00
Sergei Golubchik
47f5632d60 MDEV-3837 Assertion `table->read_set == &table->def_read_set' failed on updating a performance_schema table
This was failing not only for P_S, but for any engine that had
HA_PRIMARY_KEY_REQUIRED_FOR_DELETE flag set (in the tree - only P_S and federated).
Because of this flag, read_set and write_set were (possibly) changed
on update. But later the code modified these bitmaps and restored them to the default
state, losing HA_PRIMARY_KEY_REQUIRED_FOR_DELETE related changes.

sql/handler.cc:
  small optimization.
  don't change the *write* set only because all columns has to be *read*
2012-12-15 21:54:18 +01:00
Sergei Golubchik
2217717ff6 MDEV-3860 backport --plugin-load-add (and related mysql-test changes)
revno: 3383
  revision-id: georgi.kodinov@oracle.com-20110818083108-qa3h3ufqu4zne80a
  committer: Georgi Kodinov <Georgi.Kodinov@Oracle.com>
  timestamp: Thu 2011-08-18 11:31:08 +0300
  message:

  Bug #11766001: 59026: ALLOW MULTIPLE --PLUGIN-LOAD OPTIONS
  
  Implemented support for a new command line option :
  --plugin-load-add=<comma-separated-name-equals-value-list>
  This option takes the same type of arguments that --plugin-load does
  and complements --plugin-load (that continues to operate as before) by
  appending its argument to the list specified by --plugin-load.
  So --plugin-load can be considered a composite option consisting of 
  resetting the plugin load list and then calling --plugin-load-add to process
  the argument.
  Note that the order in which you specify --plugin-load and --plugin-load-add 
  is important : "--plugin-load=x --plugin-load-add=y" will be equivalent to
  "--plugin-load=x,y" whereas "--plugin-load-add=y --plugin-load=x" will be 
  equivalent to "plugin-load=x".
  
  Incompatible change : the --help --verbose command will no longer print the 
  --plugin-load variable's values (as it doesn't have one). Otherwise both --plugin-load 
  and --plugin-load-add are mentioned in it.
2012-12-15 18:24:11 +01:00
Igor Babaev
e44253a125 Merge 5.5 -> mwl248 2012-12-14 12:02:08 -08:00
unknown
40bbf697aa MDEV-532: Async InnoDB commit checkpoint.
Make the commit checkpoint inside InnoDB be asynchroneous.
Implement a background thread in binlog to do the writing and flushing of
binlog checkpoint events to disk.
2012-12-14 15:38:07 +01:00
unknown
e97d6232f3 Automatic merge MDEV-452 with the latest 10.0-base. 2012-12-14 09:51:06 +02:00
Igor Babaev
a06224bd15 Addressed all remaining issues from the review of the patch
that introduced engine independent persistent statistics.
In particular:
- added an enumeration type for possible values of the system
  variable use_stat_tables
- renamed KEY::real_rec_per_key to KEY::actual_rec_per_key
- optimized the collection of statistical data for any primary
  key defined only on one column.
2012-12-13 23:05:12 -08:00
unknown
6e8c4d696a MDEV-452 Add full support for auto-initialized/updated timestamp and datetime
Post-review changes according to Monty's review from 28/11/2012.
2012-12-13 22:56:03 +02:00
Igor Babaev
65820439bd Fixed bug mdev-3891.
If a query referenced some system statistical tables, but not all of them,
then executing an ANALYZE command simultaneously with this query could
lead to a deadlock.
The fix prohibited reading statistics from system statistical tables
for such queries.

Removed the function unlock_tables_n_open_system_tables_for_write()
as not used anymore.
Performed some minor refactoring of the code in sql_statistics.cc.
2012-12-12 23:16:54 -08:00
unknown
17d63e5be2 New results of --big test (MDEV-3862 fix). 2012-12-12 19:54:04 +02:00
Sergei Golubchik
532d9c3028 one-byte overflow with old passwords 2012-12-11 09:50:48 +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
Igor Babaev
109c104d07 Addressed the following issue from the review of the patch for
engine-independent statistics.
If a table was created for InnoDB then the execution of the
ANALYZE command over this table blocked any INSERT/DELETE/UPDATE
of the table.
2012-12-09 21:33:08 -08:00
Igor Babaev
2447bc4c81 Addressed the following issue from the review of the patch for
engine-independent statistics.
When the primary key was dropped or changed statistics on secondary
indexes for the prefixes that included components of the primary 
key was not removed from the table mysql.index_stats.

Also fixed: in the some cases when a column was changed statistics
on the indexes that included this column was not removed from the
table mysql.index_stats.

Also disabled the test mdev-504 for --ps-protocol.
2012-12-08 15:38:15 -08:00
unknown
e06cd80415 2012-12-07 19:10:20 +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
Igor Babaev
dd119466c3 Addressed the following issues from the review of the patch:
1. The PERSISTENT FOR clause of the ANALYZE command overrides
the setting of the system variable use_stat_tables: 
with this clause ANALYZE unconditionally collects persistent
statistics.
2. ANALYZE collects persistent statistics only for tables of
the USER category. So it never collects persistent statistics
for system tables.
2012-12-05 22:51:11 -08: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
Igor Babaev
81563081e5 Adjusted results for a test.
The adjustment was supposed to be done in the previous commit.
2012-12-05 09:57:34 -08: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
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
Igor Babaev
b110132516 Changed the names of the system tables for statistical data:
table_stat  -> table_stats
  column_stat -> column_stats
  index_stat  -> index_stats
to be in line with the names of innodb statistical tables 
from mysql-5.6: innodb_table_stats and innodb_index_stats.
2012-12-05 00:31:05 -08:00
Igor Babaev
f8bfb65b13 Merge 5.5->mwl248 2012-12-04 19:04:25 -08:00