Commit graph

203 commits

Author SHA1 Message Date
Marc Alff
899038030a Bug#58798 SHOW ENGINE PERFORMANCE_SCHEMA STATUS: incorrect table lettercase
Before this fix, the output of SHOW ENGINE PERFORMANCE_SCHEMA STATUS
used uppercase to name performance schema tables.

This is inconsistent since performance schema tables have been renamed to lowercase.

Also, an old table 'PROCESSLIST' was still visible, 
even after this table got renamed to 'threads'.

This fix:
- correctly uses lowercases in the output, to match the current naming.
- replaced 'PROCESSLIST' with 'threads'.

Tested the output of SHOW ENGINE PERFORMANCE_SCHEMA STATUS manually.
No automated test cases can be written for this, 
since the output is too platform dependent (sizes).
2010-12-07 21:00:33 +01:00
Marc Alff
4372875aa1 Bug#53696 Performance schema engine violates the PSEA API by calling my_error()
This is a code cleanup.

The implementation of a storage engine (subclasses of handler) is not supposed
to call my_error() directly inside the engine implementation, 
but only return error codes, and report errors later at the demand
of the sql layer only (if needed), using handler::print_error().

This fix removes misplaced calls to my_error(),
and provide an implementation of print_error() instead.

Given that the sql layer implementation of create table, ha_create_table(),
does not use print_error() but returns ER_CANT_CREATE_TABLE directly,
the return code for create table statements using the performance schema
has changed to ER_CANT_CREATE_TABLE.

Adjusted the test suite accordingly.
2010-12-01 13:06:41 +01:00
Marc Alff
9d9699209d local merge 2010-11-21 14:32:48 +01:00
Davi Arnaut
8664de2230 WL#5665: Removal of the autotools-based build system
The autotools-based build system has been superseded and
is being removed in order to ease the maintenance burden on
developers tweaking and maintaining the build system.

In order to support tools that need to extract the server
version, a new file that (only) contains the server version,
called VERSION, is introduced. The file contents are human
and machine-readable. The format is:

MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5
MYSQL_VERSION_PATCH=8
MYSQL_VERSION_EXTRA=-rc

The CMake based version extraction in cmake/mysql_version.cmake
is changed to extract the version from this file. The configure
to CMake wrapper is retained for backwards compatibility and to
support the BUILD/ scripts. Also, a new a makefile target
show-dist-name that prints the server version is introduced.

VERSION:
  Add top-level version file.
cmake/mysql_version.cmake:
  Get version information from the top-level VERSION file.
  Do not cache the version components (MAJOR_VERSION, etc).
  Add MYSQL_RPM_VERSION as a replacement for MYSQL_U_SCORE_VERSION.
2010-11-20 12:47:50 -02:00
Marc Alff
ce89012c8b Bug#56760 PFS_lock::allocated_to_free() assert failures on osx10.5-x86-64bit
Before this fix, an assert could fail in PFS_lock::allocated_to_free(), during shutdown.
The assert itself is valid, and detects an anomaly caused by bug 56666.

While bug 56666 has no real consequences in production,
the failure caused by this new assert in the code is negatively
impacting the test suite with automated tests.

This fix is a work around only, that relaxes the integrity checks 
during the server shutdown.
2010-11-16 09:36:42 +01:00
Marc Alff
6272025ad4 Bug#58003 Segfault on CHECKSUM TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG EXTENDED
This fix is a follow up on the fix for similar issue 56761.

When sanitizing data read from the events_waits_history_long table,
the code needs also to sanitize the schema_name / object_name / file_name pointers,
because such pointers could also hold invalid values.
Checking the string length alone was required but not sufficient.

This fix verifies that:
- the table schema and table name used in table io events
- the file name used in file io events
are valid pointers before dereferencing these pointers.
2010-11-11 12:34:46 +01:00
Marc Alff
4e1678daca Bug#57609 performance_schema does not work with lower_case_table_names
Before this fix, the performance schema tables were defined in UPPERCASE.

This was incompatible with the lowercase_table_names option, and caused
issues with the install / upgrade process, when changing the lower case
table names setting *after* the install or upgrade.

With this fix, all performance schema tables are exposed with lowercase names.
As a result, the name of the performance schema table is always lowercase,
no matter how / if / when the lowercase_table_names setting if changed.
2010-11-03 16:42:33 +01:00
Marc Alff
b431da6214 local merge 2010-10-26 11:02:32 +02:00
Marc Alff
d51cd894da Bug#57154 Rename THREADS.ID to THREADS.PROCESSLIST_ID in 5.5
This change is to align the 5.5 performance_schema.THREADS
table definition with the 5.6 performance_schema.THREADS table,
to facilitate the 5.5 -> 5.6 migration later.

In the table performance_schema.THREADS:
- renamed ID to PROCESSLIST_ID, removed not null
- changed NAME from varchar(64) to varchar(128)
to match the columns definitions from 5.6

Adjusted the test cases accordingly.

Note: this fix is for 5.5 only, to null merge into 5.6
2010-10-06 18:03:27 -06:00
Davi Arnaut
a5efb91dea Bug#49938: Failing assertion: inode or deadlock in fsp/fsp0fsp.c
Bug#54678: InnoDB, TRUNCATE, ALTER, I_S SELECT, crash or deadlock

- Incompatible change: truncate no longer resorts to a row by
row delete if the storage engine does not support the truncate
method. Consequently, the count of affected rows does not, in
any case, reflect the actual number of rows.

- Incompatible change: it is no longer possible to truncate a
table that participates as a parent in a foreign key constraint,
unless it is a self-referencing constraint (both parent and child
are in the same table). To work around this incompatible change
and still be able to truncate such tables, disable foreign checks
with SET foreign_key_checks=0 before truncate. Alternatively, if
foreign key checks are necessary, please use a DELETE statement
without a WHERE condition.

Problem description:

The problem was that for storage engines that do not support
truncate table via a external drop and recreate, such as InnoDB
which implements truncate via a internal drop and recreate, the
delete_all_rows method could be invoked with a shared metadata
lock, causing problems if the engine needed exclusive access
to some internal metadata. This problem originated with the
fact that there is no truncate specific handler method, which
ended up leading to a abuse of the delete_all_rows method that
is primarily used for delete operations without a condition.

Solution:

The solution is to introduce a truncate handler method that is
invoked when the engine does not support truncation via a table
drop and recreate. This method is invoked under a exclusive
metadata lock, so that there is only a single instance of the
table when the method is invoked.

Also, the method is not invoked and a error is thrown if
the table is a parent in a non-self-referencing foreign key
relationship. This was necessary to avoid inconsistency as
some integrity checks are bypassed. This is inline with the
fact that truncate is primarily a DDL operation that was
designed to quickly remove all data from a table.

mysql-test/suite/innodb/t/innodb-truncate.test:
  Add test cases for truncate and foreign key checks.
  Also test that InnoDB resets auto-increment on truncate.
mysql-test/suite/innodb/t/innodb.test:
  FK is not necessary, test is related to auto-increment.
  
  Update error number, truncate is no longer invoked if
  table is parent in a FK relationship.
mysql-test/suite/innodb/t/innodb_mysql.test:
  Update error number, truncate is no longer invoked if
  table is parent in a FK relationship.
  
  Use delete instead of truncate, test is used to check
  the interaction of FKs, triggers and delete.
mysql-test/suite/parts/inc/partition_check.inc:
  Fix typo.
mysql-test/suite/sys_vars/t/foreign_key_checks_func.test:
  Update error number, truncate is no longer invoked if
  table is parent in a FK relationship.
mysql-test/t/mdl_sync.test:
  Modify test case to reflect and ensure that truncate takes
  a exclusive metadata lock.
mysql-test/t/trigger-trans.test:
  Update error number, truncate is no longer invoked if
  table is parent in a FK relationship.
sql/ha_partition.cc:
  Reorganize the various truncate methods. delete_all_rows is now
  passed directly to the underlying engines, so as truncate. The
  code responsible for truncating individual partitions is moved
  to ha_partition::truncate_partition, which is invoked when a
  ALTER TABLE t1 TRUNCATE PARTITION p statement is executed.
  
  Since the partition truncate no longer can be invoked via
  delete, the bitmap operations are not necessary anymore. The
  explicit reset of the auto-increment value is also removed
  as the underlying engines are now responsible for reseting
  the value.
sql/handler.cc:
  Wire up the handler truncate method.
sql/handler.h:
  Introduce and document the truncate handler method. It assumes
  certain use cases of delete_all_rows.
  
  Add method to retrieve the list of foreign keys referencing a
  table. Method is used to avoid truncating tables that are
  parent in a foreign key relationship.
sql/share/errmsg-utf8.txt:
  Add error message for truncate and FK.
sql/sql_lex.h:
  Introduce a flag so that the partition engine can detect when
  a partition is being truncated. Used to give a special error.
sql/sql_parse.cc:
  Function mysql_truncate_table no longer exists.
sql/sql_partition_admin.cc:
  Implement the TRUNCATE PARTITION statement.
sql/sql_truncate.cc:
  Change the truncate table implementation to use the new truncate
  handler method and to not rely on row-by-row delete anymore.
  
  The truncate handler method is always invoked with a exclusive
  metadata lock. Also, it is no longer possible to truncate a
  table that is parent in some non-self-referencing foreign key.
storage/archive/ha_archive.cc:
  Rename method as the description indicates that in the future
  this could be a truncate operation.
storage/blackhole/ha_blackhole.cc:
  Implement truncate as no operation for the blackhole engine in
  order to remain compatible with older releases.
storage/federated/ha_federated.cc:
  Introduce truncate method that invokes delete_all_rows.
  This is required to support partition truncate as this
  form of truncate does not implement the drop and recreate
  protocol.
storage/heap/ha_heap.cc:
  Introduce truncate method that invokes delete_all_rows.
  This is required to support partition truncate as this
  form of truncate does not implement the drop and recreate
  protocol.
storage/ibmdb2i/ha_ibmdb2i.cc:
  Introduce truncate method that invokes delete_all_rows.
  This is required to support partition truncate as this
  form of truncate does not implement the drop and recreate
  protocol.
storage/innobase/handler/ha_innodb.cc:
  Rename delete_all_rows to truncate. InnoDB now does truncate
  under a exclusive metadata lock.
  
  Introduce and reorganize methods used to retrieve the list
  of foreign keys referenced by a or referencing a table.
storage/myisammrg/ha_myisammrg.cc:
  Introduce truncate method that invokes delete_all_rows.
  This is required in order to remain compatible with earlier
  releases where truncate would resort to a row-by-row delete.
2010-10-06 11:34:28 -03:00
Marc Alff
14ac8c79ff Bug#50557 checksum table crashes server when used in performance_schema
CHECKSUM TABLE for performance schema tables could cause uninitialized
memory reads.

The root cause is a design flaw in the implementation of
mysql_checksum_table(), which do not honor null fields.

However, fixing this bug in CHECKSUM TABLE is risky, as it can cause the
checksum value to change.

This fix implements a work around, to systematically reset fields values
even for null fields, so that the field memory representation is always
initialized with a known value.
2010-09-17 13:03:09 -06:00
Marc Alff
623863fdc7 Bug#56761 Segfault on CHECKSUM TABLE performance_schema.EVENTS_WAITS_HISTORY EXTENDED
Before this fix, the server could crash inside a memcpy when reading data
from the EVENTS_WAITS_CURRENT / HISTORY / HISTORY_LONG  tables.

The root cause is that the length used in a memcpy could be corrupted,
when another thread writes data in the wait record being read.
Reading unsafe data is ok, per design choice, and the code does sanitize
the data in general, but did not sanitize the length given to memcpy.

The fix is to also sanitize the schema name / object name / file name
length when extracting the data to produce a row.
2010-09-15 12:20:48 -06:00
Tor Didriksen
73384c99c0 Header files should be self-contained 2010-09-10 11:10:38 +02:00
Marc Alff
f943a12055 Bug#56521 Assertion failed: (m_state == 2), function allocated_to_free, pfs_lock.h (138)
Before this fix, it was possible to build the server:
- with the performance schema
- with a dummy implementation of my_atomic (MY_ATOMIC_MODE_DUMMY).

In this case, the resulting binary will just crash,
as this configuration is not supported.

This fix enforces that the build will fail with a compilation error in this
configuration, instead of resulting in a broken binary.
2010-09-09 14:28:47 -06:00
Marc Alff
a5aad2e7dc local merge 2010-08-27 15:23:37 -06:00
Christopher Powers
7e0cc48ed6 Bug# 53874 "SETUP_INSTRUMENTS.TIMED='NO' should not change TIMER_WAIT
Handle combined instrument states of ENABLED and/or TIMED:

ENABLED TIMED
1 1 Aggregate stats, increment counter
1 0 Increment counter
0 1 Do nothing
0 0 Do nothing 

storage/perfschema/pfs.cc:
  Aggregate stats only if state is both ENABLED and TIMED. If ENABLED
  but not TIMED, only increment the value counter.
storage/perfschema/pfs_stat.h:
  Split aggregate and counter increment into separate
  methods for performance.
2010-08-26 10:45:25 -05:00
Marc Alff
19e67ad27c Bug#55576 Two perfschema tests failed on mysql-next-mr-innodb PB2 tests
Before this fix, some tests failed due to lack of instrumentation slots
in the performance schema, because the default sizing was too low.

Now that more code has been instrumented, the default sizing has to be adjusted
to match the current instrumentation consumption.

This change:
- increases the number of rwlock classes from 20 to 30,
- increases the number of rwlock and mutex instances to 1 million.
Both are to account for the volume of data instrumented
when the innodb storage engine is used (because of the innodb buffer pool).

Adjusted the test output accordingly.
2010-08-24 18:21:43 -06:00
Christopher Powers
02155b7173 Bug#53874, "SETUP_INSTRUMENTS.TIMED='NO' should not change TIMER_WAIT in aggregations"
end_*_wait() functions now honor TIMER_STATE_UNTIMED

storage/perfschema/pfs.cc:
  Don't aggregate stats if TIMER_STATE_UNTIMED
2010-08-19 17:24:07 -05:00
Marc Alff
26f1efd981 Bug#55416 Renaming of performance_schema tables for 5.5
Removed table SETUP_OBJECTS.
      
Renamed table PROCESSLIST to THREADS.
      
Renamed table EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
to EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME.
      
Adjusted Makefiles, code and tests accordingly.
2010-08-12 08:08:52 -06:00
Marc Alff
a1d90f124f Bug#55462 Performance schema: reduce the overhead of PFS_events_waits::m_wait_class
This is a performance improvement fix.

Removed the "volatile" property of PFS_events_waits::m_wait_class.
Simplified the code accordingly.
2010-08-12 03:51:58 -06:00
Davi Arnaut
e001970cc7 WL#5498: Remove dead and unused source code
Remove workarounds for ancient systems.

mysys/default.c:
  Make cast more explicit to ensure a correct offset.
2010-07-23 17:17:55 -03:00
Davi Arnaut
bc4ba28cab WL#5498: Remove dead and unused source code
Remove unused variables.
2010-07-23 17:13:36 -03:00
Marc Alff
102d04dd65 Bug#52134 performance schema file io, symlink in path
Backport from mysql-next-mr (5.6) to mysql-trunk (5.5)
2010-07-15 19:25:03 -06:00
Marc Alff
3725080c25 Bug#53617 Missing performance schema tables not reported in the server log at startup
Backport from mysql-next-mr (5.6) to mysql-trunk (5.5)
2010-07-15 19:18:44 -06:00
Marc Alff
e04de9783a Bug#52502 Performance schema does not start with large mutex_instance buffers
Backport from mysql-next-mr (5.6) to mysql-trunk (5.5)
2010-07-15 19:03:08 -06:00
Marc Alff
36e80ced63 Bug#52586 Misleading error message on attempt to access a P_S table using a wrong name
Backport from mysql-next-mr (5.6) to mysql-trunk (5.5)
2010-07-15 18:50:39 -06:00
Marc Alff
bc6092a497 Bug#53566 SHOW ENGINE PERFORMANCE_SCHEMA STATUS reports less memory than really used
Backporting the fix from myql-next-mr (5.6) to mysql-trunk (5.5)
2010-07-15 18:28:52 -06:00
Marc Alff
aa2daceebc Bug#53148 Remove PFS_readonly_table
This fix is for cleanup, to resolve a remaining code review item.
Backport from mysql-next-mr (5.6) to mysql-trunk (5.5).
2010-07-15 18:06:33 -06:00
Marc Alff
4b1f459ae0 Fixed Copyright headers in storage/perfschema
Fixed minor merge issues with #includes
2010-07-15 17:44:45 -06:00
Marc Alff
ec41287630 Bug#55087 Performance schema: optimization of the instrumentation interface
This change is for performance optimization.

Fixed the performance schema instrumentation interface as follows:
- simplified mysql_unlock_mutex()
- simplified mysql_unlock_rwlock()
- simplified mysql_cond_signal()
- simplified mysql_cond_broadcast()

Changed the get_thread_XXX_locker apis to have one extra parameter,
to provide memory to the instrumentation implementation.
This API change allows to use memory provided by the caller,
to avoid having to use thread local storage.
Using this extra parameter will be done in a separate fix,
this change is for the interface only.

Adjusted all the code and unit tests accordingly.
2010-07-09 17:00:24 -06:00
Davi Arnaut
f56dd32bf7 Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled
Essentially, the problem is that safemalloc is excruciatingly
slow as it checks all allocated blocks for overrun at each
memory management primitive, yielding a almost exponential
slowdown for the memory management functions (malloc, realloc,
free). The overrun check basically consists of verifying some
bytes of a block for certain magic keys, which catches some
simple forms of overrun. Another minor problem is violation
of aliasing rules and that its own internal list of blocks
is prone to corruption.

Another issue with safemalloc is rather the maintenance cost
as the tool has a significant impact on the server code.
Given the magnitude of memory debuggers available nowadays,
especially those that are provided with the platform malloc
implementation, maintenance of a in-house and largely obsolete
memory debugger becomes a burden that is not worth the effort
due to its slowness and lack of support for detecting more
common forms of heap corruption.

Since there are third-party tools that can provide the same
functionality at a lower or comparable performance cost, the
solution is to simply remove safemalloc. Third-party tools
can provide the same functionality at a lower or comparable
performance cost. 

The removal of safemalloc also allows a simplification of the
malloc wrappers, removing quite a bit of kludge: redefinition
of my_malloc, my_free and the removal of the unused second
argument of my_free. Since free() always check whether the
supplied pointer is null, redudant checks are also removed.

Also, this patch adds unit testing for my_malloc and moves
my_realloc implementation into the same file as the other
memory allocation primitives.

client/mysqldump.c:
  Pass my_free directly as its signature is compatible with the
  callback type -- which wasn't the case for free_table_ent.
2010-07-08 18:20:08 -03:00
Davi Arnaut
a8c288054e Bug#53445: Build with -Wall and fix warnings that it generates
Fix various mismatches between function's language linkage. Any
particular function that is declared in C++ but should be callable
from C must have C linkage. Note that function types with different
linkages are also distinct. Thus, if a function type is declared in
C code, it will have C linkage (same if declared in a extern "C"
block).

client/mysql.cc:
  Mismatch between prototype and declaration.
client/mysqltest.cc:
  mysqltest used to be C code. Use C linkage where appropriate.
cmd-line-utils/readline/input.c:
  Isolate unreachable code.
include/my_alloc.h:
  Function type must have C linkage.
include/my_base.h:
  Function type must have C linkage.
include/my_global.h:
  Add helper macros to avoid spurious namespace indentation.
include/mysql.h.pp:
  Update ABI file.
mysys/my_gethwaddr.c:
  Remove stray carriage return and fix coding style.
plugin/semisync/semisync_master_plugin.cc:
  Callback function types have C linkage.
plugin/semisync/semisync_slave_plugin.cc:
  Callback function types have C linkage.
sql/derror.cc:
  Expected function type has C linkage.
sql/field.cc:
  Use helper macro and fix indentation.
sql/handler.cc:
  Expected function type has C linkage.
sql/item_sum.cc:
  Correct function linkages. Remove now unnecessary cast.
sql/item_sum.h:
  Add prototypes with the appropriate linkage as otherwise they
  are distinct.
sql/mysqld.cc:
  Wrap functions in C linkage mode.
sql/opt_range.cc:
  C language linkage is ignored for class member functions.
sql/partition_info.cc:
  Add wrapper functions with C linkage for class member functions.
sql/rpl_utility.h:
  Use helper macro and fix indentation.
sql/sql_class.cc:
  Change type of thd argument -- THD is a class.
  Use helper macro and fix indentation.
sql/sql_class.h:
  Change type of thd argument -- THD is a class.
sql/sql_select.cc:
  Expected function type has C linkage.
sql/sql_select.h:
  Move prototype to sql_test.h
sql/sql_show.cc:
  Expected function type has C linkage.
sql/sql_test.cc:
  Fix required function prototype and fix coding style.
sql/sql_test.h:
  Removed unnecessary export and add another.
storage/myisammrg/ha_myisammrg.cc:
  Expected function type has C linkage.
storage/perfschema/pfs.cc:
  PSI headers are declared with C language linkage, which also
  applies to function types.
2010-05-31 12:29:54 -03:00
Vladislav Vaintroub
cd35dd73a1 Fix perfschema unittests build on Windows
pthread_t is not defined unless my_pthread.h is included.
2010-04-13 13:48:46 +02:00
Marc Alff
bbf97ab183 Bug#52754 Build break in mysql-trunk, performance schema unit test
Tree cleaup after the last major merges in mysql-trunk:

The files sql/lex_hash.h and sql/sql_yacc.h are automatically
generated, and should not be checked in the configuration management system.
These files are now removed.
No changes are required for .bzrignore, which already listed these files
(and similar files in libmysqld/).

The file storage/perfschema/unittest/pfs_timer-t.cc did not build
after the header files refactoring affecting mysql_priv.h
The file now builds properly using sql_priv.h
2010-04-12 03:31:45 -06:00
Mats Kindahl
e92b3c587c WL#5030: Splitting mysql_priv.h
Adding include to build on Windows.
2010-04-06 23:00:01 +02:00
Mats Kindahl
6791cfc76a WL#5030: Splitting mysql_priv.h
Adding includes of my_global.h that seems to be necessary on Windows.
2010-04-06 16:08:51 +02:00
Mats Kindahl
23d8586dbf WL#5030: Split and remove mysql_priv.h
This patch:

- Moves all definitions from the mysql_priv.h file into
  header files for the component where the variable is
  defined
- Creates header files if the component lacks one
- Eliminates all include directives from mysql_priv.h
- Eliminates all circular include cycles
- Rename time.cc to sql_time.cc
- Rename mysql_priv.h to sql_priv.h
2010-03-31 16:05:33 +02:00
Marc Alff
8c28d0d1cf local merge 2010-03-07 10:41:51 -07:00
Marc Alff
01b19dbbf4 Bug#51738 Unit test pfs_instr-t crashes
The unit test pfs_instr-t:
- generates a very long (10,000) bytes file name
- calls find_or_create_file.

This leads to a buffer overflow in mysys in my_realpath(),
because my_realpath and mysys file APIs in general do not
test for input parameters: mysys assumes every file name
is less that FN_REFLEN in length.

Calling find_or_create_file with a very long file name is likely
to happen when instrumenting third party code that does not use mysys,
so this test is legitimate.

The fix is to make find_or_create_file in the performance schema
more robust in this case.
2010-03-04 18:36:54 -07:00
Marc Alff
18884b02c0 Bug#51741 Unit test pfs-t failing in mysql-next-mr-bugfixing
The root cause of the failure is that when
Bug#51447 performance schema evil twin files
was fixed, instrumented file names got normalized.

The pfs-t unit test depends on this file normalization,
but it was not updated.

This fix aligns pfs-t.cc lookup_file_by_name()
with the logic in pfs_instr.cc find_or_create_file().
2010-03-04 18:10:27 -07:00
Marc Alff
77385a9136 Bug#51612 Un initialized locker_lost variable in pfs_instr.cc
Fixed the missing initialization of locker_lost.

This fix is not strictly necessary, but is desirable to re-align the code
from 5.5 and 6.0, and reduce the spurious code differences.

This will facilitate maintenance and help to apply patches cleanly, for merges.
2010-03-01 17:10:01 -07:00
Marc Alff
d6131618bb Bug#51447 performance schema evil twin files
Before this fix, the performance schema file instrumentation would treat:
- a relative path to a file
- an absolute path to the same file
as two different files.

This would lead to:
- separate aggregation counters
- file leaks when a file is removed.

With this fix, a relative and absolute path are resolved to the same file instrument.
2010-02-26 10:39:57 -07:00
Jon Olav Hauglid
e60ef89317 Followup to Bug#45225 Locking: hang if drop table with no timeout
This patch prevents system threads and system table accesses from
using user-specified values for "lock_wait_timeout". Instead all
such accesses are done using the default value (1 year).

This prevents background tasks (such as replication, events, 
accessing stored function definitions, logging, reading time-zone
information, etc.) from failing in cases where the global value
of "lock_wait_timeout" is set very low.

The patch also simplifies the open tables API. Rather than adding
another convenience function for opening and locking system tables,
this patch removes most of the existing convenience functions for
open_and_lock_tables_derived(). Before, open_and_lock_tables() was
a convenience function that enforced derived tables handling, while
open_and_lock_tables_derived() was the main function where derived
tables handling was optional. Now, this convencience function is
gone and the main function is renamed to open_and_lock_tables(). 

No test case added as it would have required the use of --sleep to
check that system threads and system tables have a different timeout
value from the user-specified "lock_wait_timeout" system variable.
2010-02-24 18:04:00 +01:00
Vladislav Vaintroub
5b77604cc2 merge 2010-02-16 23:19:47 +01:00
Alexander Nozdrin
a8ef1bafb1 Manual merge from mysql-next-mr.
Conflicts:
  - sql/log_event.cc
  - sql/sql_class.h
2010-02-15 14:16:49 +03:00
Vladislav Vaintroub
e3a4741d05 merge 2010-02-13 17:01:32 +01:00
Konstantin Osipov
a9e22b5896 Merge next-mr -> next-4284-merge. 2010-02-04 20:34:15 +03:00
Vladislav Vaintroub
da91b8d73e Cleanup casing in MYSQL_ADD_PLUGIN, patch provided by Kent 2010-02-01 23:46:02 +01:00
Marc Alff
a1917ee687 Bug#44210 Performance schema: pool-of-threads threads instrumentation is missing
WL#5136 Pool of threads

Added an explicit delete_thread() API in the instrumentation,
to be used by the pool of threads implementations.
2010-01-26 16:42:54 -07:00
Marc Alff
f62eb05d08 Bug#50478 perfschema.tampered_perfschema_table1 fails sporadically on
Windows and Solaris

Reviewed every call to my_error() using the va_args parameters,
to make sure the arguments type are ok.

Fixed the broken calls to my_error() to pass a strings as 'char *',
not LEX_STRING.
2010-01-22 17:15:16 -07:00
Vladislav Vaintroub
cd45a44180 Post-merge fixes , define HAVE_RWLOCK_T on Solaris define
DISABLE_MYSQL_THREAD_H for strings
Also, enable unittests for perfschema
2010-01-14 18:42:28 +00:00
Vladislav Vaintroub
6b6f0ca461 merge 2010-01-14 16:07:27 +01:00
Marc Alff
e0e0f9e3d4 WL#2360 Performance schema
Part V: performance schema implementation
2010-01-11 18:47:27 -07:00