BY CACHING OR REDUCING CREATEEVENT CALLS".
5.5 versions of MySQL server performed worse than 5.1 versions
under single-connection workload in autocommit mode on Windows XP.
Part of this slowdown can be attributed to overhead associated
with constant creation/destruction of MDL_lock objects in the MDL
subsystem. The problem is that creation/destruction of these
objects causes creation and destruction of associated
synchronization primitives, which are expensive on Windows XP.
This patch tries to alleviate this problem by introducing a cache
of unused MDL_object_lock objects. Instead of destroying such
objects we put them into the cache and then reuse with a new
key when creation of a new object is requested.
To limit the size of this cache, a new --metadata-locks-cache-size
start-up parameter was introduced.
mysql-test/r/mysqld--help-notwin.result:
Updated test after adding --metadata-locks-cache-size
parameter.
mysql-test/r/mysqld--help-win.result:
Updated test after adding --metadata-locks-cache-size
parameter.
mysql-test/suite/sys_vars/r/metadata_locks_cache_size_basic.result:
Added test coverage for newly introduced --metadata_locks_cache_size
start-up parameter and corresponding global read-only variable.
mysql-test/suite/sys_vars/t/metadata_locks_cache_size_basic-master.opt:
Added test coverage for newly introduced --metadata_locks_cache_size
start-up parameter and corresponding global read-only variable.
mysql-test/suite/sys_vars/t/metadata_locks_cache_size_basic.test:
Added test coverage for newly introduced --metadata_locks_cache_size
start-up parameter and corresponding global read-only variable.
sql/mdl.cc:
Introduced caching of unused MDL_object_lock objects, in order to
avoid costs associated with constant creation and destruction of
such objects in single-connection workloads run in autocommit mode.
Such costs can be pretty high on systems where creation and
destruction of synchronization primitives require a system call
(e.g. Windows XP).
To implement this cache,a list of unused MDL_object_lock instances
was added to MDL_map object. Instead of being destroyed
MDL_object_lock instances are put into this list and re-used later
when creation of a new instance is required. Also added
MDL_lock::m_version counter to allow threads having outstanding
references to an MDL_object_lock instance to notice that it has
been moved to the unused objects list.
Added a global variable for a start-up parameter that limits
the size of the unused objects list.
Note that we don't cache MDL_scoped_lock objects since they
are supposed to be created only during execution of DDL
statements and therefore should not affect performance much.
sql/mdl.h:
Added a global variable for start-up parameter that limits the
size of the unused MDL_object_lock objects list and constant
for its default value.
sql/sql_plist.h:
Added I_P_List<>::pop_front() function.
sql/sys_vars.cc:
Introduced --metadata-locks-cache-size start-up parameter
for specifying size of the cache of unused MDL_object_lock
objects.
of service in prepared statements).
sql/sql_prepare.cc:
At mysql_stmt_get_longdata(): instead of pushing an internal
error handler (as done in 5.1-tree) we save, set and restore
the statement's diagnostics area and warning info.
mysql-test/r/mysqld--help-notwin.result:
consequence of introducing opt_autocommit and its default
mysql-test/suite/sys_vars/r/autocommit_func4.result:
Before this fix, this test would have shown @@global.autocommit == 0
in spite of --autocommit=on.
mysql-test/suite/sys_vars/r/autocommit_func5.result:
result unchanged by the fix
sql/mysqld.cc:
atoi(argument) was reliable for =0|1 parameters. Now that boolean options
must support =on/off/true/false, atoi(argument) is wrong (being always 0
for those strings). Instead, let the internal logic of my_getopt
(in particular get_bool_argument()) set a boolean opt_autocommit
properly, and use that to set global_system_variables.option_bits.
add boolean command-line option --autocommit.
mysql-test/mysql-test-run.pl:
do in --gdb like in --ddd: to let the developer debug the startup
phase (like command-line options parsing), don't "run".
It's the third time I do this change, it was previously lost
by merges, port of 6.0 to next-mr...
mysql-test/r/mysqld--help-notwin.result:
new command-line option
mysql-test/r/mysqld--help-win.result:
a Linux user's best guess at what the Windows result should be
mysql-test/suite/sys_vars/inc/autocommit_func2.inc:
new test
mysql-test/suite/sys_vars/t/autocommit_func2-master.opt:
test new option
mysql-test/suite/sys_vars/t/autocommit_func3-master.opt:
test new option
sql/mysqld.cc:
new --autocommit
sql/mysqld.h:
new --autocommit
sql/sql_partition.cc:
What matters to this partitioning quote is to have
the OPTION_QUOTE_SHOW_CREATE flag down, it's all
that append_identifier() uses. So we make it explicit.
The default storage engine is changed from MyISAM to
InnoDB, in all builds except for the embedded server.
In addition, the following system variables are
changed:
* innodb_file_per_table is enabled
* innodb_strict_mode is enabled
* innodb_file_format_name_update is changed
to 'Barracuda'
The test suite is changed so that tests that do not
explicitly include the have_innodb.inc are run with
--default-storage-engine=MyISAM. This is to ease the
transition, so that most regression tests are run
with the same engine as before.
Some tests are disabled for the embedded server
regression test, as the output of certain statements
will be different that for the regular server
(i.e SELECT @@default_storage_engine). This is to
ease transition.
mysql-test/mysql-test-run.pl:
The regression test suite now adds a
--default-storage-engine=MyISAM for all non-innodb
tests. This behaviour can be controlled by the
default-myisam switch in mysql-test-run
mysql-test/t/bootstrap-master.opt:
The bootstrap test can only be run without InnoDB
as it starts several mysqld instances on the same
datadir. This is possible with MyISAM, but not
with InnoDB.
storage/innobase/CMakeLists.txt:
Build InnoDB per default
storage/innobase/handler/ha_innodb.cc:
Change default values for system variables
Enable file_per_table
Enable strict_mode
Upgrade default file format to Barracuda
Add deprecation warning when variable optimizer_search_depth is given
the value 63.
mysql-test/r/greedy_optimizer.result
Updated with warning text.
mysql-test/r/mysqld--help-notwin.result
Updated with warning from mysqld --help --verbose.
mysql-test/r/mysqld--help-win.result
Updated with warning from mysqld --help --verbose.
sql/sys_vars.cc
Added an update check function to the constructor invocation for
the optimizer_search_depth variable. The function emits a
warning message for the value 63.
WL#5154 was a task for formally deprecating and removing items that
were mentioned in the manual as having been deprecated since MySQL
4.1 or 5.0, but that had never been removed.
Since WL#5154 was created, examination of mysqld.cc, mysql.cc, and
mysqldump.c reveals additional deprecations not mentioned in the
manual. (In some cases, the items are simply not mentioned in the
5.1+ manuals.)
This is a follow-on task to deprecate and remove these additional
items.
The deprecation happened in MySQL 5.1, and the options/variables
are now removed from the code.
client/mysql.cc:
--no-tee is now removed
client/mysqldump.c:
--all is now removed
-a now points to --create-options
sql/mysqld.cc:
delay-key-write-for-all-tables is removed
--enable-locking is removed
--log-update is removed
--skip-locking is removed
--skip-symlink is removed
--sql-bin-update-same is removed
--warnings is removed
--record-buffer is removed
A set of program options and variables was deprecated in
MySQL 5.1, and is hereby removed.
client/mysql.cc:
--no-auto-rehash (-A) is no longer deprecated
--no-named-commands (-g) is now removed
--skip-line-numbers (-L) is no longer deprecated
--set-variable (-O) is now removed
--no-pager is now removed
client/mysqlbinlog.cc:
--position is now removed (use --start-position)
-j is now equivalent with --start-position
client/mysqldump.c:
--first-slave is now removed
--no-set-names (-N) is now removed
--set-variable (-O) is now removed
mysql-test/include/default_mysqld.cnf:
default-character-set is removed as an option
character-set-server is equivalent.
mysql-test/t/bug47671-master.opt:
default-character-set option is removed
character-set-server is equivalent
mysql-test/t/ctype_latin1_de-master.opt:
default-character-set option is removed
character-set-server is equivalent
mysql-test/t/ctype_ucs2_def-master.opt:
default-collation is removed
collation-server is equicalent
scripts/mysqld_multi.sh:
--config-file has been superseded by
--defaults-extra-file
sql/mysql_priv.h:
Removed the version number in the deprecation
warning text, as decided by ServerPT.
sql/mysqld.cc:
--default-character-set (-C) is removed
--default-collation is removed
--log-long-format (-0) is removed
--safe-show-database is removed
--set-variable (-O) is removed
sql/sql_yacc.yy:
The FRAC_SECOND keyword is removed
sql/sys_vars.cc:
The sql_log_update system variable is removed
This patch removes the unused server variable
"table_lock_wait_timeout".
mysql-test/r/variables.result:
Updated the test for Bug#28580 to reflect that
"table_lock_wait_timeout" no longer exists.
mysql-test/t/variables.test:
Updated the test for Bug#28580 to reflect that
"table_lock_wait_timeout" no longer exists.
This patch introduces timeouts for metadata locks.
The timeout is specified in seconds using the new dynamic system
variable "lock_wait_timeout" which has both GLOBAL and SESSION
scopes. Allowed values range from 1 to 31536000 seconds (= 1 year).
The default value is 1 year.
The new server parameter "lock-wait-timeout" can be used to set
the default value parameter upon server startup.
"lock_wait_timeout" applies to all statements that use metadata locks.
These include DML and DDL operations on tables, views, stored procedures
and stored functions. They also include LOCK TABLES, FLUSH TABLES WITH
READ LOCK and HANDLER statements.
The patch also changes thr_lock.c code (table data locks used by MyISAM
and other simplistic engines) to use the same system variable.
InnoDB row locks are unaffected.
One exception to the handling of the "lock_wait_timeout" variable
is delayed inserts. All delayed inserts are executed with a timeout
of 1 year regardless of the setting for the global variable. As the
connection issuing the delayed insert gets no notification of
delayed insert timeouts, we want to avoid unnecessary timeouts.
It's important to note that the timeout value is used for each lock
acquired and that one statement can take more than one lock.
A statement can therefore block for longer than the lock_wait_timeout
value before reporting a timeout error. When lock timeout occurs,
ER_LOCK_WAIT_TIMEOUT is reported.
Test case added to lock_multi.test.
include/my_pthread.h:
Added macros for comparing two timespec structs.
include/thr_lock.h:
Introduced timeouts for thr_lock.c locks.
mysql-test/r/mysqld--help-notwin.result:
Updated result file with the new server variable.
mysql-test/r/mysqld--help-win.result:
Updated result file with the new server variable.
mysql-test/suite/sys_vars/r/lock_wait_timeout_basic.result:
Added basic test for the new server variable.
mysql-test/suite/sys_vars/t/lock_wait_timeout_basic.test:
Added basic test for the new server variable.
mysys/thr_lock.c:
Introduced timeouts for thr_lock.c locks.
sql/mdl.cc:
Introduced timeouts for metadata locks.
sql/mdl.h:
Introduced timeouts for metadata locks.
sql/sql_base.cc:
Introduced timeouts in tdc_wait_for_old_versions().
sql/sql_class.h:
Added new server variable lock_wait_timeout.
sql/sys_vars.cc:
Added new server variable lock_wait_timeout.
- mysqld--help-win
Updated result so that it contains missing
value for slave-type-conversions
- rpl_idempotency
This seems a bad merge. In BUG#39934, the contents of
this file had been split into rpl_row_idempontency and
rpl_idempotency. The patch was pushed to 5.1-rep+3 which
was later merged in rep+2-delivery1 which in turn was
merged in 5.1-rpl-merge. Now while merging next-mr in
5.1-rpl-merge, the file got back it's old content (which
is in rpl_row_idempotency now because of BUG#39934). This
cset reverts the bad merge:
bzr merge -r revid:dao-gang.qu@sun.com-20100112120709-ioxp11yl9bvquaqd..\
before:revid:dao-gang.qu@sun.com-20100112120709-ioxp11yl9bvquaqd\
suite/rpl/t/rpl_idempotency.test
- sys_vars.all_vars:
Added test case for slave_type_conversions variable
- rpl_row_idempotency
Removed ER_SLAVE_AMBIGOUS_EXEC_MODE (which was removed by WL 4738)
from the test case. Using ER_WRONG_VALUE_FOR_VAR instead.
- mysqld--help-win
Added missing help for --slave-type-conversions from the
result file.
in mysqld--help test.
When mysql is compiled with different options,columns
might have different size (this depends on parameter
names and some parameters might only be available
when some option is switched on)
"set engine_condition_pushdown" is deprecated, engine condition pushdown is controlled
by a new "set optimizer_switch=engine_condition_pushdown=on|off".
mysql-test/r/index_merge_myisam.result:
@@optimizer_switch has a new flag
mysql-test/r/mysqld--help-notwin.result:
@@optimizer_switch has a new flag
mysql-test/r/mysqld--help-win.result:
@@optimizer_switch has a new flag
mysql-test/r/optimizer_switch_eng_cond_pushdown1.result:
Check how --engine-condition-pushdown and --optimizer-switch influence each other when used together (last wins).
mysql-test/r/optimizer_switch_eng_cond_pushdown2.result:
Check how --engine-condition-pushdown and --optimizer-switch influence each other when used together (last wins).
mysql-test/suite/ndb/r/ndb_condition_pushdown.result:
@@engine_condition_pushdown is deprecated, use @@optimizer_switch instead
mysql-test/suite/ndb/r/ndb_gis.result:
@@engine_condition_pushdown is deprecated, use @@optimizer_switch instead
mysql-test/suite/ndb/r/ndb_index_unique.result:
@@engine_condition_pushdown is deprecated, use @@optimizer_switch instead
mysql-test/suite/ndb/t/ndb_condition_pushdown.test:
@@engine_condition_pushdown is deprecated, use @@optimizer_switch instead
mysql-test/suite/ndb/t/ndb_gis.test:
@@engine_condition_pushdown is deprecated, use @@optimizer_switch instead
mysql-test/suite/ndb/t/ndb_index_unique.test:
@@engine_condition_pushdown is deprecated, use @@optimizer_switch instead
mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result:
Setting @@engine_condition_pushdown gives a deprecation warning now.
We test that the engine_condition_pushdown flag of @@optimizer_switch, and @@engine_condition_pushdown
influence each other (turning the flag on/off sets the variable on/off and vice-versa).
mysql-test/suite/sys_vars/r/optimizer_switch_basic.result:
@@optimizer_switch has a new flag
mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test:
Setting @@engine_condition_pushdown gives a deprecation warning now.
We test that the engine_condition_pushdown flag of @@optimizer_switch, and @@engine_condition_pushdown
influence each other (turning the flag on/off sets the variable on/off and vice-versa).
mysql-test/t/optimizer_switch_eng_cond_pushdown1-master.opt:
Check how --engine-condition-pushdown and --optimizer-switch influence each other when used together (last wins).
mysql-test/t/optimizer_switch_eng_cond_pushdown1.test:
Check how --engine-condition-pushdown and --optimizer-switch influence each other when used together (last wins).
mysql-test/t/optimizer_switch_eng_cond_pushdown2-master.opt:
Check how --engine-condition-pushdown and --optimizer-switch influence each other when used together (last wins).
mysql-test/t/optimizer_switch_eng_cond_pushdown2.test:
Check how --engine-condition-pushdown and --optimizer-switch influence each other when used together (last wins).
sql/mysql_priv.h:
new "engine_condition_pushdown" switch in @@optimizer_switch, on by default, like
@@engine_condition_pushdown is on by default. Constants are ULL because optimizer_switch
is stored in a ulonglong.
sql/mysqld.cc:
Making --engine-condition-pushdown and --optimizer-switch (command-line options)
influence each other (last wins)
sql/records.cc:
@@engine_condition_pushdown is deprecated, use @@optimizer_switch instead
sql/sql_select.cc:
@@engine_condition_pushdown is deprecated, use @@optimizer_switch instead
sql/sys_vars.cc:
Setting @@engine_condition_pushdown now issues a deprecation message. The version for removal
is unknown at this point so I copied it from other deprecation warnings in this file.
Turning on/off the engine_condition_pushdown flag of @@optimizer_switch (with SET) turns on/off the @@engine_condition_pushdown variable, and vice-versa, thanks to fix_* functions.