Commit graph

539 commits

Author SHA1 Message Date
Dmitry Lenev
ae1ae4bd63 Fix for bug #51263 "Deadlock between transactional
SELECT and ALTER TABLE ...  REBUILD PARTITION".

ALTER TABLE on InnoDB table (including partitioned tables)
acquired exclusive locks on rows of table being altered.
In cases when there was concurrent transaction which did
locking reads from this table this sometimes led to a
deadlock which was not detected by MDL subsystem nor by
InnoDB engine (and was reported only after exceeding
innodb_lock_wait_timeout).

This problem stemmed from the fact that ALTER TABLE acquired
TL_WRITE_ALLOW_READ lock on table being altered. This lock
was interpreted as a write lock and thus for table being
altered handler::external_lock() method was called with
F_WRLCK as an argument. As result InnoDB engine treated
ALTER TABLE as an operation which is going to change data
and acquired LOCK_X locks on rows being read from old
version of table.

In case when there was a transaction which already acquired
SR metadata lock on table and some LOCK_S locks on its rows
(e.g. by using it in subquery of DML statement) concurrent
ALTER TABLE was blocked at the moment when it tried to
acquire LOCK_X lock before reading one of these rows.
The transaction's attempt to acquire SW metadata lock on
table being altered led to deadlock, since it had to wait
for ALTER TABLE to release SNW lock. This deadlock was not
detected and got resolved only after timeout expiring
because waiting were happening in two different subsystems.

Similar deadlocks could have occured in other situations.
This patch tries to solve the problem by changing ALTER TABLE
implementation to use TL_READ_NO_INSERT lock instead of
TL_WRITE_ALLOW_READ. After this step handler::external_lock()
is called with F_RDLCK as an argument and InnoDB engine
correctly interprets ALTER TABLE as operation which only
reads data from original version of table. Thanks to this
ALTER TABLE acquires only LOCK_S locks on rows it reads.
This, in its turn, causes inter-subsystem deadlocks to go
away, as all potential lock conflicts and thus deadlocks will
be limited to metadata locking subsystem:

- When ALTER TABLE reads rows from table being altered it
  can't encounter any locks which conflict with LOCK_S row
  locks. There should be no concurrent transactions holding
  LOCK_X row locks. Such a transaction should have been
  acquired SW metadata lock on table first which would have
  conflicted with ALTER's SNW lock.
- Vice versa, when DML which runs concurrently with ALTER
  TABLE tries to lock row it should be requesting only LOCK_S
  lock which is compatible with locks acquired by ALTER,
  as otherwise such DML must own an SW metadata lock on table
  which would be incompatible with ALTER's SNW lock.

mysql-test/r/innodb_mysql_lock2.result:
  Added test for bug #51263 "Deadlock between transactional
  SELECT and ALTER TABLE ... REBUILD PARTITION".
mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result:
  Since CREATE TRIGGER no longer acquires write lock on table
  it is no longer interpreted as an operation which modifies
  table data and therefore no longer fails if invoked for
  SBR-only engine in ROW mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test:
  Since CREATE TRIGGER no longer acquires write lock on table
  it is no longer interpreted as an operation which modifies
  table data and therefore no longer fails if invoked for
  SBR-only engine in ROW mode.
mysql-test/t/innodb_mysql_lock2.test:
  Added test for bug #51263 "Deadlock between transactional
  SELECT and ALTER TABLE ... REBUILD PARTITION".
sql/ha_partition.cc:
  When ALTER TABLE creates a new partition to be filled from
  other partition lock it in F_WRLCK mode instead of using
  mode which was used for locking the whole table (it is
  F_RDLCK now).
sql/lock.cc:
  Replaced conditions which used TL_WRITE_ALLOW_READ
  lock type with equivalent conditions using
  TL_WRITE_ALLOW_WRITE. This should allow to get rid
  of TL_WRITE_ALLOW_READ lock type eventually.
sql/mdl.cc:
  Updated outdated comment to reflect current situation.
sql/sql_base.cc:
  Replaced conditions which used TL_WRITE_ALLOW_READ
  lock type with equivalent conditions using
  TL_WRITE_ALLOW_WRITE. This should allow to get rid
  of TL_WRITE_ALLOW_READ lock type eventually.
sql/sql_table.cc:
  mysql_admin_table():
    Use TL_WRITE_ALLOW_WRITE lock type instead of
    TL_WRITE_ALLOW_READ to determine that we need to acquire
    upgradable metadata lock. This should allow to completely
    get rid of TL_WRITE_ALLOW_READ in long term.
  mysql_recreate_table():
    ALTER TABLE now requires TL_READ_NO_INSERT thr_lock.c lock
    instead of TL_WRITE_ALLOW_READ.
sql/sql_trigger.cc:
  Changed CREATE/DROP TRIGGER implementation to use
  TL_READ_NO_INSERT lock instead of TL_WRITE_ALLOW_READ lock.
  The latter is no longer necessary since:
  a) We now can rely on metadata locks to achieve proper
     isolation between two DDL statements or DDL and DML
     statements.
  b) This statement does not change any data in table so there
     is no need to inform storage engine about it.
sql/sql_yacc.yy:
  Changed implementation of ALTER TABLE (and CREATE/DROP INDEX
  as a consequence) to use TL_READ_NO_INSERT lock instead of
  TL_WRITE_ALLOW_READ lock. This is possible since:
  a) We now can rely on metadata locks to achieve proper
     isolation between two DDL statements or DDL and DML
     statements.
  b) This statement only reads data in table being open.
     We write data only to the new version of table and
     then replace with it old version of table under
     X metadata lock.
  
  Thanks to this change InnoDB will no longer acquire LOCK_X
  locks on rows being read by ALTER TABLE (instead LOCK_S
  locks will be acquired) and thus cause of bug #51263
  "Deadlock between transactional SELECT and ALTER TABLE ...
  REBUILD PARTITION" is removed.
  
  Did the similar change for CREATE TRIGGER (see comments
  for sql_trigger.cc for details).
2010-05-26 16:18:08 +04:00
Mattias Jonsson
42d91c688c merge 2010-05-25 15:45:01 +02:00
Mattias Jonsson
0fdd97af48 Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
Problem was reporting wrong error

Fixed by adding a new error which better explain the problem.

mysql-test/r/partition_error.result:
  Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
  
  Updated test result
mysql-test/t/partition_error.test:
  Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
  
  Added test case
sql/ha_partition.cc:
  Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
  
  Better error message. (used ER_UNKNOWN_ERROR to avoid merge
  problems in mysql-trunk+)
2010-05-25 15:41:00 +02:00
Mattias Jonsson
7af0bbc3bc Merge of bug#51851.
Also moved HA_DATA_PARTITION from ha_partition.cc to table.h.
2010-05-24 14:51:59 +02:00
Mattias Jonsson
6ef03ea37c merge into mysql-5.1-bugteam
sql/ha_partition.cc:
  Bug#49477, added safety that a partitioned table cannot be
  temporary.
2010-05-21 14:18:14 +02:00
Alexey Kopytov
e118ec409f Manual merge from mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts:

Text conflict in sql/sql_base.cc
Text conflict in sql/sql_partition.cc
Text conflict in sql/sql_priv.h
Text conflict in sql/sql_show.cc
2010-05-11 20:02:50 +04:00
Sergei Golubchik
a3e8ae1280 A temporary solution to make CREATE TABLE attributes
to work when a table is partitioned
2010-05-11 16:49:23 +02:00
unknown
b1e00b6be8 Merge MySQL 5.1.46 into MariaDB.
Still two test failures to be solved: main.myisam and main.subselect.
2010-04-28 14:52:24 +02:00
Sergei Golubchik
e24e1668bc MWL#43 CREATE TABLE options (by Sanja)
Docs/sp-imp-spec.txt:
  New sql_mode added.
include/my_base.h:
  Flag in frm of create options.
libmysqld/CMakeLists.txt:
  New files added.
libmysqld/Makefile.am:
  New files added.
mysql-test/r/events_bugs.result:
  New sql_mode added.
mysql-test/r/information_schema.result:
  New sql_mode added.
mysql-test/r/sp.result:
  New sql_mode added.
mysql-test/r/system_mysql_db.result:
  New sql_mode added.
mysql-test/suite/funcs_1/r/is_columns_mysql.result:
  New sql_mode added.
mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result:
  New sql_mode added.
mysql-test/t/events_bugs.test:
  New sql_mode added.
mysql-test/t/sp.test:
  New sql_mode added.
scripts/mysql_system_tables.sql:
  New sql_mode added.
scripts/mysql_system_tables_fix.sql:
  New sql_mode added.
sql/CMakeLists.txt:
  New files added.
sql/Makefile.am:
  New files added.
sql/event_db_repository.cc:
  New sql_mode added.
sql/field.cc:
  Create options support added.
sql/field.h:
  Create options support added.
sql/ha_partition.cc:
  Create options support added.
sql/handler.cc:
  Create options support added.
sql/handler.h:
  Create options support added.
sql/log_event.h:
  New sql_mode added.
sql/mysql_priv.h:
  New sql_mode added.
sql/mysqld.cc:
  New sql_mode added.
sql/share/errmsg.txt:
  New error messages added.
sql/sp.cc:
  New sql_mode added.
sql/sp_head.cc:
  Create options support added.
sql/sql_class.cc:
  Create options support added.
  Debug added.
sql/sql_class.h:
  Create options support added.
sql/sql_insert.cc:
  my_safe_a* moved to mysqld_priv.h
sql/sql_lex.h:
  Create options support added.
sql/sql_parse.cc:
  Create options support added.
sql/sql_show.cc:
  Create options support added.
sql/sql_table.cc:
  Create options support added.
sql/sql_view.cc:
  New sql_mode added.
sql/sql_yacc.yy:
  Create options support added.
sql/structs.h:
  Create options support added.
sql/table.cc:
  Create options support added.
sql/table.h:
  Create options support added.
sql/unireg.cc:
  Create options support added.
storage/example/ha_example.cc:
  Create options example.
storage/example/ha_example.h:
  Create options example.
storage/pbxt/src/discover_xt.cc:
  Create options support added.
2010-04-08 14:10:05 +02:00
unknown
20739646d7 Maria WL#61
Interface for maria extensions.
  Alternative plugin interface with additional info (maturity and string version).

CMakeLists.txt:
  Maria plugin interface used.
config/ac-macros/plugins.m4:
  Maria plugin interface used.
configure.in:
  Maria plugin interface used.
include/mysql/plugin.h:
  Maria plugin interface added.
include/mysql/plugin_auth.h.pp:
  Maria plugin interface added.
plugin/auth/auth_socket.c:
  Maria plugin interface added.
plugin/auth/dialog.c:
  Maria plugin interface added.
plugin/daemon_example/daemon_example.cc:
  Maria plugin interface added.
plugin/fulltext/plugin_example.c:
  Maria plugin interface added.
sql/ha_ndbcluster.cc:
  Maria plugin interface added.
sql/ha_partition.cc:
  Maria plugin interface added.
sql/log.cc:
  Maria plugin interface added.
sql/sql_acl.cc:
  Maria plugin interface added.
sql/sql_builtin.cc.in:
  Maria plugin interface used.
sql/sql_plugin.cc:
  Maria plugin interface added.
sql/sql_plugin.h:
  Maria plugin interface used.
sql/sql_show.cc:
  Maria plugin interface added.
storage/archive/ha_archive.cc:
  Maria plugin interface added.
storage/blackhole/ha_blackhole.cc:
  Maria plugin interface added.
storage/csv/ha_tina.cc:
  Maria plugin interface added.
storage/example/ha_example.cc:
  Maria plugin interface added.
storage/federated/ha_federated.cc:
  Maria plugin interface added.
storage/federatedx/ha_federatedx.cc:
  Maria plugin interface added.
storage/heap/ha_heap.cc:
  Maria plugin interface added.
storage/ibmdb2i/ha_ibmdb2i.cc:
  Maria plugin interface added.
storage/innobase/handler/ha_innodb.cc:
  Maria plugin interface added.
storage/innodb_plugin/handler/i_s.cc:
  Maria plugin interface added.
storage/maria/ha_maria.cc:
  Maria plugin interface added.
storage/myisam/ha_myisam.cc:
  Maria plugin interface added.
storage/myisammrg/ha_myisammrg.cc:
  Maria plugin interface added.
storage/pbxt/src/ha_pbxt.cc:
  Maria plugin interface added.
storage/xtradb/handler/ha_innodb.cc:
  Maria plugin interface added.
storage/xtradb/handler/i_s.cc:
  Maria plugin interface added.
storage/xtradb/handler/i_s.h:
  Maria plugin interface added.
2010-04-01 17:34:51 +03: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
Mattias Jonsson
47906997c7 Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table

Problem was that the ha_data structure was introduced in 5.1
and only used for partitioning first, but with the intention
of be of use for others engines as well, and when used by other
engines it would clash if it also was partitioned.

Solution is to move the partitioning specific data to a separate
structure, with its own mutex (which is used for auto_increment).

Also did rename PARTITION_INFO to PARTITION_STATS since there
already exist a class named partition_info, also cleaned up
some related variables.

mysql-test/r/partition_binlog_stmt.result:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  New result file
mysql-test/t/partition_binlog_stmt.test:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  New result file
sql/ha_ndbcluster.cc:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Rename of PARTITION_INFO to PARTITION_STATS to better
  match the use (and there is also a class named
  partition_info...)
sql/ha_ndbcluster.h:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Rename of PARTITION_INFO to PARTITION_STATS to better
  match the use (and there is also a class named
  partition_info...)
sql/ha_partition.cc:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Removed the partitioning engines use of ha_data in
  TABLE_SHARE and added ha_part_data instead, since
  they collide if used in the same time.
  
  Rename of PARTITION_INFO to PARTITION_STATS to better
  match the use (and there is also a class named
  partition_info...)
  
  Removed some dead code.
sql/ha_partition.h:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Removed some dead code.
  
  Rename of PARTITION_INFO to PARTITION_STATS to better
  match the use (and there is also a class named
  partition_info...)
  
  Removed the partitioning engines use of ha_data in
  TABLE_SHARE and added ha_part_data instead, since
  they collide if used in the same time.
sql/handler.cc:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Rename of PARTITION_INFO to PARTITION_STATS to better
  match the use (and there is also a class named
  partition_info...)
sql/handler.h:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Rename of PARTITION_INFO to PARTITION_STATS to better
  match the use (and there is also a class named
  partition_info...)
sql/mysql_priv.h:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Removed the partitioning engines use of ha_data in
  TABLE_SHARE and added ha_part_data instead, since
  they collide if used in the same time.
  
  Added key_PARTITION_LOCK_auto_inc for instrumentation.
sql/mysqld.cc:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Removed the partitioning engines use of ha_data in
  TABLE_SHARE and added ha_part_data instead, since
  they collide if used in the same time.
  
  Added key_PARTITION_LOCK_auto_inc for instrumentation.
sql/partition_info.h:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Removed part_state* since it was not in use.
sql/sql_partition.cc:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Removed part_state* since it was not in use.
sql/sql_partition.h:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Cleaned up old commented out code.
  
  Removed part_state* since it was not in use.
sql/sql_show.cc:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Rename of PARTITION_INFO to PARTITION_STATS to better
  match the use (and there is also a class named
  partition_info...)
  
  Renamed partition_info to partition_info_str, since
  partition_info is a name of a class.
sql/sql_table.cc:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Renamed partition_info to partition_info_str, since
  partition_info is a name of a class.
sql/table.cc:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Removed the partitioning engines use of ha_data in
  TABLE_SHARE and added ha_part_data instead, since
  they collide if used in the same time.
  
  Renamed partition_info to partition_info_str, since
  partition_info is a name of a class.
  
  removed part_state* since it was not in use.
sql/table.h:
  Bug#51851: Server with SBR locks mutex twice on LOAD DATA
  into partitioned MyISAM table
  
  Removed the partitioning engines use of ha_data in
  TABLE_SHARE and added ha_part_data instead, since
  they collide if used in the same time.
  
  Renamed partition_info to partition_info_str, since
  partition_info is a name of a class.
  
  removed part_state* since it was not in use.
2010-03-30 22:52:45 +02:00
Alexey Kopytov
d95c1e3b47 Manual merge of mysql-trunk into mysql-trunk-merge.
Conflicts:

Text conflict in client/mysqlbinlog.cc
Text conflict in mysql-test/Makefile.am
Text conflict in mysql-test/collections/default.daily
Text conflict in mysql-test/r/mysqlbinlog_row_innodb.result
Text conflict in mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
Text conflict in mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
Text conflict in mysql-test/suite/rpl/t/rpl_row_create_table.test
Text conflict in mysql-test/suite/rpl/t/rpl_slave_skip.test
Text conflict in mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
Text conflict in mysys/charset.c
Text conflict in sql/field.cc
Text conflict in sql/field.h
Text conflict in sql/item.h
Text conflict in sql/item_func.cc
Text conflict in sql/log.cc
Text conflict in sql/log_event.cc
Text conflict in sql/log_event_old.cc
Text conflict in sql/mysqld.cc
Text conflict in sql/rpl_utility.cc
Text conflict in sql/rpl_utility.h
Text conflict in sql/set_var.cc
Text conflict in sql/share/Makefile.am
Text conflict in sql/sql_delete.cc
Text conflict in sql/sql_plugin.cc
Text conflict in sql/sql_select.cc
Text conflict in sql/sql_table.cc
Text conflict in storage/example/ha_example.h
Text conflict in storage/federated/ha_federated.cc
Text conflict in storage/myisammrg/ha_myisammrg.cc
Text conflict in storage/myisammrg/myrg_open.c
2010-03-24 18:03:44 +03:00
Alexey Kopytov
5d407d0c1a Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts:

Text conflict in mysql-test/r/partition_innodb.result
Text conflict in sql/field.h
Text conflict in sql/item.h
Text conflict in sql/item_cmpfunc.h
Text conflict in sql/item_sum.h
Text conflict in sql/log_event_old.cc
Text conflict in sql/protocol.cc
Text conflict in sql/sql_select.cc
Text conflict in sql/sql_yacc.yy
2010-03-20 23:23:42 +03:00
Mattias Jonsson
5196beed02 Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
concurrent I_S query

There were two problem:
1) MYSQL_LOCK_IGNORE_FLUSH also ignored name locks
2) there was a race between abort_and_upgrade_locks and
   alter_close_tables
   (i.e. remove_table_from_cache and
    close_data_files_and_morph_locks)

Which allowed the table to be opened with MYSQL_LOCK_IGNORE_FLUSH flag
resulting in renaming a partition that was already in use,
which could cause the table to be unusable.

Solution was to not allow IGNORE_FLUSH to skip waiting for
a named locked table.

And to not release the LOCK_open mutex between the
calls to remove_table_from_cache and
close_data_files_and_morph_locks by merging the functions
abort_and_upgrade_locks and alter_close_tables.

mysql-test/suite/parts/r/partition_debug_sync_innodb.result:
  Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
  concurrent I_S query
  
  Added test result
mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt:
  Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
  concurrent I_S query
  
  Added test option
mysql-test/suite/parts/t/partition_debug_sync_innodb.test:
  Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
  concurrent I_S query
  
  Added test file
sql/authors.h:
  Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
  concurrent I_S query
  
  Time to be acknowledged :)
sql/ha_partition.cc:
  Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
  concurrent I_S query
  
  Added DEBUG_SYNC for deterministic testing
sql/mysql_priv.h:
  Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
  concurrent I_S query
  
  Renamed function since merging alter_close_tables into
  abort_and_upgrade_lock.
sql/sql_base.cc:
  Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
  concurrent I_S query
  
  Changed MYSQL_LOCK_IGNORE_FLUSH to not ignore name locks
  (open_placeholder).
  
  Merged alter_close_tables into abort_and_upgrade_locks
  (and added _and_close_table to the name)
  to not release LOCK_open between remove_table_from_cache
  and close_data_files_and_morph_locks.
  
  Added DEBUG_SYNC for deterministic testing.
sql/sql_partition.cc:
  Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
  concurrent I_S query
  
  Removed alter_close_tables, (merged it into
  abort_and_upgrad_lock) so that LOCK_open never is released
  between remove_table_from_cache and
  close_data_files_and_morph_locks.
sql/sql_show.cc:
  Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
  concurrent I_S query
  
  Added DEBUG_SYNC for deterministic testing
2010-03-17 15:10:41 +01:00
Mattias Jonsson
f3190ea61f merged 2010-03-12 11:14:40 +01:00
Mattias Jonsson
1a9ec92049 merge 2010-03-11 14:18:44 +01:00
Mattias Jonsson
1f77c7b49a Bug#50392: insert_id is not reset for partitioned tables
auto_increment on duplicate entry

The bug was that when INSERT_ID was used and the storage
engine was told to release any reserved but not used
auto_increment values, it set the highest auto_increment
value to INSERT_ID.

The fix was to check if the auto_increment value was forced
by user (INSERT_ID) or by slave-thread, i.e. not auto-
generated. So that it is only allowed to release generated
values.

mysql-test/r/partition_error.result:
  Bug#50392: insert_id is not reset for partitioned tables
  auto_increment on duplicate entry
  
  updated result
mysql-test/suite/parts/inc/partition_auto_increment.inc:
  Bug#50392: insert_id is not reset for partitioned tables
  auto_increment on duplicate entry
  
  Added test
mysql-test/suite/parts/r/partition_auto_increment_archive.result:
  Bug#50392: insert_id is not reset for partitioned tables
  auto_increment on duplicate entry
  
  Added result, note that archive does only allow increasing
  auto_increment values
mysql-test/suite/parts/r/partition_auto_increment_blackhole.result:
  Bug#50392: insert_id is not reset for partitioned tables
  auto_increment on duplicate entry
  
  Added result, note that blackhole accepts all inserts :)
mysql-test/suite/parts/r/partition_auto_increment_innodb.result:
  Bug#50392: insert_id is not reset for partitioned tables
  auto_increment on duplicate entry
  
  Added result, note that innodb rolls back inserts on error,
  but keeps the auto_increment value.
mysql-test/suite/parts/r/partition_auto_increment_memory.result:
  Bug#50392: insert_id is not reset for partitioned tables
  auto_increment on duplicate entry
  
  Added result, note that memory and myisam inserts all rows
  before the error.
mysql-test/suite/parts/r/partition_auto_increment_myisam.result:
  Bug#50392: insert_id is not reset for partitioned tables
  auto_increment on duplicate entry
  
  Added result, note that memory and myisam inserts all rows
  before the error.
mysql-test/suite/parts/r/partition_auto_increment_ndb.result:
  Bug#50392: insert_id is not reset for partitioned tables
  auto_increment on duplicate entry
  
  Added result, note that NDB does not seem to handle
  INSERT_ID as other engines. (Martin will look into it).
mysql-test/t/partition_error.test:
  Bug#50392: insert_id is not reset for partitioned tables
  auto_increment on duplicate entry
  
  Added test
sql/ha_partition.cc:
  Bug#50392: insert_id is not reset for partitioned tables
  auto_increment on duplicate entry
  
  If the next_insert_id comes from non generated (i.e
  forced by INSERT_ID or slave-thread) then we cannot
  lower the reserved auto_increment value, since it have
  not reserved any values.
2010-03-04 18:16:10 +01:00
Mattias Jonsson
e46d120e8e Bug#48229: group by performance issue of partitioned table
Problem was block_size on partitioned tables was not set,
resulting in keys_per_block was not correct which affects
the cost calculation for read time of indexes (including
cost for group min/max).Which resulted in a bad optimizer
decision.

Fixed by setting stats.block_size correctly.

mysql-test/r/partition_range.result:
  Bug#48229: group by performance issue of partitioned table
  
  Added result
mysql-test/t/partition_range.test:
  Bug#48229: group by performance issue of partitioned table
  
  Added test
sql/ha_partition.cc:
  Bug#48229: group by performance issue of partitioned table
  
  Added missing assignment of stats.block_size.
2010-03-04 12:09:09 +01:00
unknown
4bf849c23c Merge MySQL 5.1.44 into MariaDB. 2010-03-04 09:03:07 +01:00
Mattias Jonsson
689b00a4a5 Fix for debug print of null string
(fails on pb for solaris debug_max)
2010-03-03 15:58:12 +01:00
Alexander Nozdrin
b3018e8613 Manual merge from mysql-trunk-merge.
Conflicts:
  - client/mysql.cc
  - client/mysqldump.c
  - configure.in
  - mysql-test/r/csv.result
  - mysql-test/r/func_time.result
  - mysql-test/r/show_check.result
  - mysql-test/r/sp-error.result
  - mysql-test/r/sp.result
  - mysql-test/r/sp_trans.result
  - mysql-test/r/type_blob.result
  - mysql-test/r/type_timestamp.result
  - mysql-test/r/warnings.result
  - mysql-test/suite/rpl/r/rpl_sp.result
  - sql/mysql_priv.h
  - sql/mysqld.cc
  - sql/sp.cc
  - sql/sql_base.cc
  - sql/sql_table.cc
  - sql/sql_trigger.cc
  - sql/sql_view.cc
  - sql/table.h
  - sql/share/errmsg.txt
  - mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result
2010-02-24 16:52:27 +03:00
Alexey Kopytov
0afa209018 Manual merge of mysql-5.1-bugteam to mysql-trunk-merge. 2010-02-22 00:33:11 +03:00
Sergei Golubchik
f09ca00e08 merged 2010-03-15 12:51:23 +01:00
Mattias Jonsson
afc3eba1f6 Manual merge (moved the check for log_table before name lock) 2010-02-12 10:03:10 +01:00
Konstantin Osipov
a72f90bc43 Merge next-mr -> next-4284.
mysql-test/t/disabled.def:
  Restore disabled ssl tests: SSL certificates were updated.
  Disable sp_sync.test, the test case can't work in next-4284.
mysql-test/t/partition_innodb.test:
  Disable parsing of the test case for Bug#47343, 
  the test can not work in next-4284.
mysql-test/t/ps_ddl.test:
  Update results (CREATE TABLE IF NOT EXISTS takes
  into account existence of the temporary table).
2010-02-06 13:28:06 +03:00
Konstantin Osipov
e7b332ba83 Merge next-mr -> next-4284. 2010-02-05 01:08:08 +03:00
Konstantin Osipov
c8555bdb35 Merge next-mr -> next-4284 2010-02-03 16:43:03 +03:00
Konstantin Osipov
056ac55aa0 Merge next-mr -> next-4284. 2010-02-03 03:06:42 +03:00
Mattias Jonsson
16c8298a85 Bug#42438: Crash ha_partition::change_table_ptr
There was two problems:
The first was the symptom, caused by bad error handling in
ha_partition. It did not handle print_error etc. when
having no partitions (when used by dummy handler).

The second was the real problem that when dropping tables
it reused the table type (storage engine) from when the lock
was asked for, not the table type that it had when gaining
the exclusive name lock. So that it tried to delete tables
from wrong storage engines.

Solutions for the first problem was to accept some handler
calls to the partitioning handler even if it was not setup
with any partitions, and also if possible fallback
to use the base handler's default functions.

Solution for the second problem was to remove the optimization
to reuse the definition from the cache, instead always check
the frm-file when holding the LOCK_open mutex

(updated with a fix for a debug print crash and better
comments as required by reviewer, and removed optimization
to avoid reading the frm-file).

mysql-test/r/partition_debug_sync.result:
  Bug#42438: Crash ha_partition::change_table_ptr
  
  New result file using DEBUG_SYNC for deterministic results.
mysql-test/t/partition_debug_sync.test:
  Bug#42438: Crash ha_partition::change_table_ptr
  
  New test file using DEBUG_SYNC for deterministic results.
sql/ha_partition.cc:
  Bug#42438: Crash ha_partition::change_table_ptr
  
  allow some handler calls, used by error handling, even when
  no partitions are setup. Fallback to default handling if possible.
sql/sql_base.cc:
  Bug#42438: Crash ha_partition::change_table_ptr
  
  Added DEBUG_SYNC point for deterministic test cases.
sql/sql_table.cc:
  Bug#42438: Crash ha_partition::change_table_ptr
  
  Always use the table type written in the .frm-file
  (i.e. the current table type) when deleting a table.
  
  Moved the check for log-table to not depend of the cache.
  
  Added DEBUG_SYNC points for deterministic test cases.
2010-02-01 16:07:00 +01:00
Alexander Nozdrin
8c94302504 Auto-merge from mysql-trunk-merge.
main.partition_innodb started to pass.
2010-01-28 00:42:22 +03:00
Alexander Nozdrin
cf97ed0c1b Manual merge from mysql-trunk-merge.
Conflicts:
  - sql/ha_partition.cc
  - sql/sql_partition.cc

The following tests started to fail:
  - main.partition_innodb (a crash)
2010-01-28 00:24:35 +03:00
Alexey Kopytov
4a1b59b7ab Manual merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-01-24 00:09:23 +03:00
Alexander Nozdrin
a6667f8577 Manual merge from mysql-trunk-merge.
Conflicts:
  - configure.in
  - include/m_string.h
  - mysql-test/extra/rpl_tests/rpl_row_func003.test
  - mysql-test/r/mysqlbinlog.result
  - mysql-test/r/union.result
  - mysql-test/suite/binlog/r/binlog_killed_simulate.result
  - mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
  - mysql-test/suite/binlog/r/binlog_unsafe.result
  - mysql-test/suite/binlog/t/binlog_unsafe.test
  - mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
  - mysql-test/suite/rpl/r/rpl_loaddata_map.result
  - mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result
  - mysql-test/suite/rpl/r/rpl_stm_log.result
  - mysql-test/suite/rpl/t/rpl_optimize.test
  - mysql-test/t/mysqlbinlog.test
  - mysql-test/t/union.test
  - sql/rpl_utility.h
  - sql/sql_union.cc
  - strings/Makefile.am
2010-01-19 19:36:14 +03:00
Mattias Jonsson
4839c42619 post-push patch for bug#47343.
Missing ha_rnd_end in copy_partitions, found due to a
DBUG_ASSERT in mysql-pe

sql/ha_partition.cc:
  Post-push patch for bug#47343
  
  Must call ha_rnd_end since ha_rnd_init has been called.
2010-01-19 17:02:51 +01:00
Mattias Jonsson
eab2be0aee Bug#47343: InnoDB fails to clean-up after lock wait timeout on
REORGANIZE PARTITION

There were several problems which lead to this this,
all related to bad error handling.

1) There was several bugs preventing the ddl-log to be used for
   cleaning up created files on error.

2) The error handling after the copy partition rows did not close
   and unlock the tables, resulting in deletion of partitions
   which were in use, which lead InnoDB to put the partition to
   drop in a background queue.

sql/ha_partition.cc:
  Bug#47343: InnoDB fails to clean-up after lock wait timeout on
             REORGANIZE PARTITION
  
  Better error handling, if partition has been created/opened/locked
  then make sure it is unlocked and closed before returning error.
  The delete of the newly created partition is handled by the ddl-log.
sql/sql_parse.cc:
  Bug#47343: InnoDB fails to clean-up after lock wait timeout on
             REORGANIZE PARTITION
  
  Fix a bug found when experimenting, thd could really be NULL here,
  as mentioned in the function header.
sql/sql_partition.cc:
  Bug#47343: InnoDB fails to clean-up after lock wait timeout on
             REORGANIZE PARTITION
  
  Used the correct .frm shadow name to put into the ddl-log.
  Really use the ddl-log to handle errors.
sql/sql_table.cc:
  Bug#47343: InnoDB fails to clean-up after lock wait timeout on
             REORGANIZE PARTITION
  
  Fixes of the ddl-log when used as error recovery (no crash).
  When executing an entry from memory (not read from disk)
  the name_len was not set correctly.
2010-01-18 17:49:18 +01:00
Alfranio Correia
40949a3110 merge mysql-next-mr --> mysql-5.1-rpl-merge
Conflicts:
  Text conflict in sql/log.cc
  Text conflict in sql/slave.cc
  Text conflict in sql/sql_base.cc
2010-01-13 12:22:34 +00:00
unknown
16e15e6952 Manual merge from next-mr. 2010-01-12 20:07:09 +08:00
Alfranio Correia
5dcb0e447f merge mysql-5.1-rep+2-delivery1 --> mysql-5.1-rpl-merge
Conflicts:

Text conflict in .bzr-mysql/default.conf
Text conflict in mysql-test/extra/rpl_tests/rpl_loaddata.test
Text conflict in mysql-test/r/mysqlbinlog2.result
Text conflict in mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
Text conflict in mysql-test/suite/binlog/r/binlog_unsafe.result
Text conflict in mysql-test/suite/rpl/r/rpl_insert_id.result
Text conflict in mysql-test/suite/rpl/r/rpl_loaddata.result
Text conflict in mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result
Text conflict in mysql-test/suite/rpl/r/rpl_udf.result
Text conflict in mysql-test/suite/rpl/t/rpl_slow_query_log.test
Text conflict in sql/field.h
Text conflict in sql/log.cc
Text conflict in sql/log_event.cc
Text conflict in sql/log_event_old.cc
Text conflict in sql/mysql_priv.h
Text conflict in sql/share/errmsg.txt
Text conflict in sql/sp.cc
Text conflict in sql/sql_acl.cc
Text conflict in sql/sql_base.cc
Text conflict in sql/sql_class.h
Text conflict in sql/sql_db.cc
Text conflict in sql/sql_delete.cc
Text conflict in sql/sql_insert.cc
Text conflict in sql/sql_lex.cc
Text conflict in sql/sql_lex.h
Text conflict in sql/sql_load.cc
Text conflict in sql/sql_table.cc
Text conflict in sql/sql_update.cc
Text conflict in sql/sql_view.cc
Conflict adding files to storage/innobase.  Created directory.
Conflict because storage/innobase is not versioned, but has versioned children.  Versioned directory.
Conflict adding file storage/innobase.  Moved existing file to storage/innobase.moved.
Conflict adding files to storage/innobase/handler.  Created directory.
Conflict because storage/innobase/handler is not versioned, but has versioned children.  Versioned directory.
Contents conflict in storage/innobase/handler/ha_innodb.cc
2010-01-07 15:39:11 +00:00
Marc Alff
3d91522561 WL#2360 Performance schema
Part IV: sql instrumentation
2010-01-06 22:42:07 -07:00
Alexey Kopytov
3ba6a2a9fa Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

mysql-test/collections/default.experimental
2009-12-25 13:56:50 +03:00
Sergei Golubchik
1ad5bb1a69 WL#4738 streamline/simplify @@variable creation process
Bug#16565 mysqld --help --verbose does not order variablesBug#20413 sql_slave_skip_counter is not shown in show variables
Bug#20415 Output of mysqld --help --verbose is incomplete
Bug#25430 variable not found in SELECT @@global.ft_max_word_len;
Bug#32902 plugin variables don't know their names
Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting!
Bug#34829 No default value for variable and setting default does not raise error
Bug#34834 ? Is accepted as a valid sql mode
Bug#34878 Few variables have default value according to documentation but error occurs  
Bug#34883 ft_boolean_syntax cant be assigned from user variable to global var.
Bug#37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status
Bug#40988 log_output_basic.test succeeded though syntactically false.
Bug#41010 enum-style command-line options are not honoured (maria.maria-recover fails)
Bug#42103 Setting key_buffer_size to a negative value may lead to very large allocations 
Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
Bug#44797 plugins w/o command-line options have no disabling option in --help
Bug#46314 string system variables don't support expressions
Bug#46470 sys_vars.max_binlog_cache_size_basic_32 is broken
Bug#46586 When using the plugin interface the type "set" for options caused a crash.
Bug#47212 Crash in DBUG_PRINT in mysqltest.cc when trying to print octal number
Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds
Bug#49417 some complaints about mysqld --help --verbose output
Bug#49540 DEFAULT value of binlog_format isn't the default value
Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix)
Bug#49644 init_connect and \0
Bug#49645 init_slave and multi-byte characters
Bug#49646 mysql --show-warnings crashes when server dies


CMakeLists.txt:
  Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
client/mysql.cc:
  don't crash with --show-warnings when mysqld dies
config/ac-macros/plugins.m4:
  Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
include/my_getopt.h:
  comments
include/my_pthread.h:
  fix double #define
mysql-test/mysql-test-run.pl:
  run sys_vars suite by default
  properly recognize envirinment variables (e.g. MTR_MAX_SAVE_CORE) set to 0
  escape gdb command line arguments
mysql-test/suite/sys_vars/r/rpl_init_slave_func.result:
  init_slave+utf8 bug
mysql-test/suite/sys_vars/t/rpl_init_slave_func.test:
  init_slave+utf8 bug
mysys/my_getopt.c:
  Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting!
  Bug#46586 When using the plugin interface the type "set" for options caused a crash.
  Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix)
mysys/typelib.c:
  support for flagset
sql/ha_ndbcluster.cc:
  backport from telco tree
sql/item_func.cc:
  Bug#49644 init_connect and \0
  Bug#49645 init_slave and multi-byte characters
sql/sql_builtin.cc.in:
  Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
sql/sql_plugin.cc:
  Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
  Bug#32902 plugin variables don't know their names
  Bug#44797 plugins w/o command-line options have no disabling option in --help
sql/sys_vars.cc:
  all server variables are defined here
storage/myisam/ft_parser.c:
  remove unnecessary updates of param->quot
storage/myisam/ha_myisam.cc:
  myisam_* variables belong here
strings/my_vsnprintf.c:
  %o and %llx
unittest/mysys/my_vsnprintf-t.c:
  %o and %llx tests
vio/viosocket.c:
  bugfix: fix @@wait_timeout to work with socket timeouts (vs. alarm thread)
2009-12-22 10:35:56 +01:00
unknown
08e4635fba merge 5.1-> 5.2 2009-12-08 23:47:54 +02:00
Konstantin Osipov
7f628ac2dd Backport of:
----------------------------------------------------------
revno: 2630.4.38
committer: Konstantin Osipov <konstantin@mysql.com>
branch nick: mysql-6.0-4144
timestamp: Wed 2008-06-25 22:07:06 +0400
message:
  WL#4144 - Lock MERGE engine children.
  Committing a version of the patch merged with WL#3726
  on behalf of Ingo.

  Step #1: Move locking from parent to children.

  MERGE children are now left in the query list of tables
  after inserted there in open_tables(). So they are locked
  by lock_tables() as all other tables are.

  The MERGE parent does not store locks any more. It appears
  in a MYSQL_LOCK with zero lock data. This is kind of a "dummy"
  lock.

  All other lock handling is also done directly on the children.
  To protect against parent or child modifications during LOCK
  TABLES, the children are detached after every statement and
  attached before every statement, even under LOCK TABLES.

  The children table list is removed from the query list of tables
  on every detach and on close of the parent.

  Step #2: Move MERGE specific functionality from SQL layer
  into table handler.

  Functionality moved from SQL layer (mainly sql_base.cc)
  to the table handler (ha_myisammrg.cc).

  Unnecessary code is removed from the SQL layer.

  Step #3: Moved all MERGE specific members from TABLE
  to ha_myisammrg.

  Moved members from TABLE to ha_myisammrg.
  Renamed some mebers.
  Fixed comments.

  Step #4: Valgrind and coverage testing

  Valgrind did not uncover new problems.
  Added purecov comments.

  Added a new test for DATA/INDEX DIRECTORY options.
  Changed handling of ::reset() for non-attached children.
  Fixed the merge-big test.

  Step #5: Fixed crashes detected during review
  Changed detection when to attach/detach.
  Added new tests.

Backport also the fix for Bug#44040 "MySQL allows creating a 
MERGE table upon VIEWs but crashes when using it"


include/my_base.h:
  WL#4144 - Lock MERGE engine children
  Added HA_EXTRA_ADD_CHILDREN_LIST and HA_EXTRA_IS_ATTACHED_CHILDREN
  for MERGE table support
mysql-test/r/merge.result:
  WL#4144 - Lock MERGE engine children
  Fixed test result.
mysql-test/t/disabled.def:
  Enable merge.test, which now is working again (WL#4144).
mysql-test/t/merge-big.test:
  Fix the messages for wait_condition (merge with WL#3726).
mysql-test/t/merge.test:
  WL#4144 - Lock MERGE engine children
  Fixed one test to meet coding standards for tests
  (upper case keywords, engine names as in SHOW ENGINES).
  Fixed error codes.
  Added a test for DATA/INDEX DIRECTORY.
mysys/thr_lock.c:
  WL#4144 - Lock MERGE engine children
  Added purecov comments.
sql/ha_partition.cc:
  WL#4144 - Lock MERGE engine children
  Added MERGE specific extra operations to ha_partition::extra().
  Extended comments.
  Changed function comment to doxygen style.
  Fixed nomenclature: 'parameter' -> 'operation'.
sql/mysql_priv.h:
  WL#4144 - Lock MERGE engine children
  Removed declarations for removed functions.
sql/sql_base.cc:
  WL#4144 - Lock MERGE engine children
  Leave the children in the query list of tables after open_tables().
  Set proper back links (prev_global).
  Attach MERGE children before and detach them after every
  statement. Even under LOCK TABLES.
  Remove children from the query list when they are detached.
  Remove lock forwarding from children to parent.
  Moved MERGE specific functions to ha_myisammrg.cc.
  Added purecov comments.
  Backport the fix for Bug#44040 "MySQL allows creating a MERGE table upon VIEWs but crashes when using it"
sql/sql_table.cc:
  WL#4144 - Lock MERGE engine children
  Changed detection of MERGE tables.
sql/table.cc:
  WL#4144 - Lock MERGE engine children
  Moved is_children_attached() method from TABLE to ha_myisammrg.
sql/table.h:
  WL#4144 - Lock MERGE engine children
  Moved all MERGE specific members from TABLE to ha_myisammrg.
storage/myisammrg/ha_myisammrg.cc:
  WL#4144 - Lock MERGE engine children
  Set proper back links in the child list (prev_global).
  Added a function for removal of the child list from the query list.
  Remove children from the query list when the parent is closed.
  Make parent lock handling a dummy (zero locks).
  Moved MERGE specific functionality from SQL layer to here.
  Moved all MERGE specific members from TABLE to ha_myisammrg.
  Renamed children list pointers.
  Added initialization and free for the children list mem_root.
  Fixed comments.
  Added purecov comments.
storage/myisammrg/ha_myisammrg.h:
  WL#4144 - Lock MERGE engine children
  Added method add_children_list().
  Moved all MERGE specific members from TABLE to ha_myisammrg.
  Renamed children list pointers.
  Added a mem_root for the children list.
storage/myisammrg/myrg_extra.c:
  WL#4144 - Lock MERGE engine children
  Changed handling of ::reset() for non-attached children.
2009-12-03 02:09:22 +03:00
Konstantin Osipov
cd055f0efe Backport of:
-------------------------------------------------------------------
revno: 2630.6.6
committer: Konstantin Osipov <konstantin@mysql.com>
branch nick: mysql-6.0-3726
timestamp: Tue 2008-05-27 16:15:44 +0400
message:
Implement code review fixes for WL#3726 "DDL locking for all
metadata objects": cleanup the code from share->mutex
acquisitions, which are now obsolete.

sql/ha_partition.cc:
  Rename share->mutex to share->LOCK_ha_data. The mutex never
  protected the entire share. The right way to protect a share
  is to acquire an MDL lock.
sql/ha_partition.h:
  Rename share->mutex to share->LOCK_ha_data.
sql/sql_base.cc:
  Remove LOCK_table_share. Do not acquire share->mutex when
  deleting a table share or incrementing its ref_count.
  All these operations are and must continue to be protected by LOCK_open
  and respective MDL locks.
sql/sql_view.cc:
  Remove acquisition of share->mutex when incrementing share->ref_count.
sql/table.cc:
  Simplify release_table_shar() by removing dead code related
  to share->mutex from it.
sql/table.h:
  Rename TABLE_SHARE::mutex to TABLE_SHARE::LOCK_ha_data
  to better reflect its purpose.
storage/myisam/ha_myisam.cc:
  Rename share->mutex to share->LOCK_ha_data.
2009-11-30 22:38:25 +03:00
Konstantin Osipov
9a9e8d2311 Backport of:
----------------------------------------------------------------------
ChangeSet@1.2571, 2008-04-08 12:30:06+02:00, vvaintroub@wva. +122 -0
  Bug#32082 : definition of VOID in my_global.h conflicts with Windows
  SDK headers
  
  VOID macro is now removed. Its usage is replaced with void cast.
  In some cases, where cast does not make much sense (pthread_*, printf, 
  hash_delete, my_seek), cast is ommited.


client/mysqladmin.cc:
  Bug#32082 : remove VOID macro
client/mysqldump.c:
  Bug#32082 : remove VOID macro
client/mysqlimport.c:
  Bug#32082 : remove VOID macro
client/mysqlslap.c:
  Bug#32082 : remove VOID macro
client/mysqltest.cc:
  Bug#32082 : remove VOID macro
client/sql_string.cc:
  Bug#32082 : remove VOID macro
extra/comp_err.c:
  Bug#32082 : remove VOID macro
extra/replace.c:
  Bug#32082 : remove VOID macro
include/my_alarm.h:
  Bug#32082 : remove VOID macro
include/my_global.h:
  Bug#32082 : remove VOID macro
libmysql/libmysql.c:
  Bug#32082 : remove VOID macro
mysys/errors.c:
  Bug#32082 : remove VOID macro
mysys/hash.c:
  Bug#32082 : remove VOID macro
mysys/mf_iocache2.c:
  Bug#32082 : remove VOID macro
mysys/mf_loadpath.c:
  Bug#32082 : remove VOID macro
mysys/mf_path.c:
  Bug#32082 : remove VOID macro
mysys/my_append.c:
  Bug#32082 : remove VOID macro
mysys/my_clock.c:
  Bug#32082 : remove VOID macro
mysys/my_copy.c:
  Bug#32082 : remove VOID macro
mysys/my_fstream.c:
  Bug#32082 : remove VOID macro
mysys/my_getwd.c:
  Bug#32082 : remove VOID macro
mysys/my_lib.c:
  Bug#32082 : remove VOID macro
mysys/my_lockmem.c:
  Bug#32082 : remove VOID macro
mysys/my_pthread.c:
  Bug#32082 : remove VOID macro
mysys/my_redel.c:
  Bug#32082 : remove VOID macro
mysys/stacktrace.c:
  Bug#32082 : remove VOID macro
mysys/thr_alarm.c:
  Bug#32082 : remove VOID macro
mysys/thr_lock.c:
  Bug#32082 : remove VOID macro
sql/derror.cc:
  Bug#32082 : remove VOID macro
sql/des_key_file.cc:
  Bug#32082 : remove VOID macro
sql/discover.cc:
  Bug#32082 : remove VOID macro
sql/field.cc:
  Bug#32082 : remove VOID macro
sql/filesort.cc:
  Bug#32082 : remove VOID macro
sql/ha_ndbcluster.cc:
  Bug#32082 : remove VOID macro
sql/ha_partition.cc:
  Bug#32082 : remove VOID macro
sql/handler.cc:
  Bug#32082 : remove VOID macro
sql/hostname.cc:
  Bug#32082 : remove VOID macro
sql/init.cc:
  Bug#32082 : remove VOID macro
sql/item.cc:
  Bug#32082 : remove VOID macro
sql/item_cmpfunc.cc:
  Bug#32082 : remove VOID macro
sql/item_strfunc.cc:
  Bug#32082 : remove VOID macro
sql/lock.cc:
  Bug#32082 : remove VOID macro
sql/log.cc:
  Bug#32082 : remove VOID macro
sql/log_event.cc:
  Bug#32082 : remove VOID macro
sql/mysqld.cc:
  Bug#32082 : remove VOID macro
sql/opt_range.h:
  Bug#32082 : remove VOID macro
sql/protocol.cc:
  Bug#32082 : remove VOID macro
sql/records.cc:
  Bug#32082 : remove VOID macro
sql/sp_head.cc:
  Bug#32082 : remove VOID macro
sql/sp_pcontext.cc:
  Bug#32082 : remove VOID macro
sql/sql_acl.cc:
  Bug#32082 : remove VOID macro
sql/sql_base.cc:
  Bug#32082 : remove VOID macro
sql/sql_cache.cc:
  Bug#32082 : remove VOID macro
sql/sql_connect.cc:
  Bug#32082 : remove VOID macro
sql/sql_db.cc:
  Bug#32082 : remove VOID macro
sql/sql_delete.cc:
  Bug#32082 : remove VOID macro
sql/sql_handler.cc:
  Bug#32082 : remove VOID macro
sql/sql_insert.cc:
  Bug#32082 : remove VOID macro
sql/sql_map.cc:
  Bug#32082 : remove VOID macro
sql/sql_parse.cc:
  Bug#32082 : remove VOID macro
sql/sql_select.cc:
  Bug#32082 : remove VOID macro
sql/sql_servers.cc:
  Bug#32082 : remove VOID macro
sql/sql_show.cc:
  Bug#32082 : remove VOID macro
sql/sql_string.cc:
  Bug#32082 : remove VOID macro
sql/sql_table.cc:
  Bug#32082 : remove VOID macro
sql/sql_test.cc:
  Bug#32082 : remove VOID macro
sql/sql_trigger.cc:
  Bug#32082 : remove VOID macro
sql/sql_update.cc:
  Bug#32082 : remove VOID macro
sql/sql_view.cc:
  Bug#32082 : remove VOID macro
sql/table.cc:
  Bug#32082 : remove VOID macro
sql/tztime.cc:
  Bug#32082 : remove VOID macro
sql/udf_example.c:
  Bug#32082 : remove VOID macro
sql/uniques.cc:
  Bug#32082 : remove VOID macro
sql/unireg.cc:
  Bug#32082 : remove VOID macro
storage/archive/ha_archive.cc:
  Bug#32082 : remove VOID macro
storage/blackhole/ha_blackhole.cc:
  Bug#32082 : remove VOID macro
storage/csv/ha_tina.cc:
  Bug#32082 : remove VOID macro
storage/csv/transparent_file.cc:
  Bug#32082 : remove VOID macro
storage/example/ha_example.cc:
  Bug#32082 : remove VOID macro
storage/federated/ha_federated.cc:
  Bug#32082 : remove VOID macro
storage/heap/hp_clear.c:
  Bug#32082 : remove VOID macro
storage/heap/hp_create.c:
  Bug#32082 : remove VOID macro
storage/heap/hp_test1.c:
  Bug#32082 : remove VOID macro
storage/heap/hp_test2.c:
  Bug#32082 : remove VOID macro
storage/innobase/handler/ha_innodb.cc:
  Bug#32082 : remove VOID macro
storage/myisam/ft_eval.c:
  Bug#32082 : remove VOID macro
storage/myisam/ha_myisam.cc:
  Bug#32082 : remove VOID macro
storage/myisam/mi_changed.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_check.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_close.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_create.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_dbug.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_delete.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_delete_all.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_dynrec.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_info.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_locking.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_log.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_open.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_packrec.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_panic.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_rsame.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_statrec.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_test1.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_test2.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_test3.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_update.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_write.c:
  Bug#32082 : remove VOID macro
storage/myisam/myisamchk.c:
  Bug#32082 : remove VOID macro
storage/myisam/myisamlog.c:
  Bug#32082 : remove VOID macro
storage/myisam/myisampack.c:
  Bug#32082 : remove VOID macro
storage/myisam/sort.c:
  Bug#32082 : remove VOID macro
storage/myisammrg/myrg_close.c:
  Bug#32082 : remove VOID macro
storage/myisammrg/myrg_create.c:
  Bug#32082 : remove VOID macro
storage/myisammrg/myrg_open.c:
  Bug#32082 : remove VOID macro
strings/str_test.c:
  Bug#32082 : remove VOID macro
tests/thread_test.c:
  Bug#32082 : remove VOID macro
2009-11-24 16:54:59 +03:00
Davi Arnaut
5aeeaaf507 Manual merge of mysql-next-mr-runtime upstream. 2009-11-19 21:48:08 -02:00
Mattias Jonsson
8734933400 Bug#48846: Too much time spent in ha_partition::records_in_range if not able to prune
Problem was that ha_partition::records_in_range called
records_in_range for all non pruned partitions, even if
an estimate should be given.

Solution is to only use 1/3 of the partitions (up to 10) for
records_in_range and estimate the total from this subset.
(And continue until a non zero return value from the called
partitions records_in_range is given, since 0 means no rows
will match.)

sql/ha_partition.cc:
  Bug#48846: Too much time spent in ha_partition::records_in_range if not able to prune
  
  estimate_rows_upper_bound and records_in_range are very similar
  (the only difference is the function and its parameters to use)
  so I created a common function for this.
  
  Since these calls from the optimizer are only estimates, it is
  not neccesary to call them for every partition, it can use
  a much smaller subset of the used partitions instead,
  which improves performance for selects.
sql/ha_partition.h:
  Bug#48846: Too much time spent in ha_partition::records_in_range if not able to prune
  
  Added two private functions to help some
  optimizer calls.
2009-11-17 20:02:16 +01:00
unknown
a962160eec Merge with MySQL 5.1, with following additions:
- Moved some code from innodb_plugin to xtradb, to ensure that all tests runs
- Did changes in pbxt and maria storage engines becasue of changes in thd->query
- Reverted wrong code in sql_table.cc for how ROW_FORMAT is used.

This is a re-commit of Monty's merge to eliminate an extra commit from
MySQL-5.1.42 that was accidentally included in the merge.

This is a merge of the MySQL 5.1.41 clone-off (clone-5.1.41-build). In
case there are any extra changes done before final MySQL 5.1.41
release, these will need to be merged later before MariaDB 5.1.41
release.
2009-11-16 21:49:51 +01:00
Igor Babaev
e4e1ae0d13 Merge of the patch introducing virtual columns into maria-5.2 2009-11-11 20:31:28 -08:00
Davi Arnaut
e879919a9f Backport of Bug#15192 to mysql-next-mr
------------------------------------------------------------
revno: 2597.4.17
revision-id: sp1r-davi@mysql.com/endora.local-20080328174753-24337
parent: sp1r-anozdrin/alik@quad.opbmk-20080328140038-16479
committer: davi@mysql.com/endora.local
timestamp: Fri 2008-03-28 14:47:53 -0300
message:
  Bug#15192 "fatal errors" are caught by handlers in stored procedures

  The problem is that fatal errors (e.g.: out of memory) were being
  caught by stored procedure exception handlers which could cause
  the execution to not be stopped due to a continue handler.

  The solution is to not call any exception handler if the error is
  fatal and send the fatal error to the client.

mysql-test/r/sp-error.result:
  Add test case result for Bug#15192
mysql-test/t/sp-error.test:
  Add test case for Bug#15192
mysys/my_alloc.c:
  Pass flag to signal fatal error in memory root allocations.
sql/event_data_objects.cc:
  Use init_sql_alloc to initialize memory roots, which uses
  the sql error handler to push errors.
sql/ha_partition.cc:
  Pass flag to signal fatal error instead of calling fatal_error.
sql/item_func.cc:
  Pass flag to signal fatal error instead of calling fatal_error.
sql/item_subselect.cc:
  Remove redundant fatal error, memory root already pushes error.
sql/opt_sum.cc:
  Pass flag to signal fatal error instead of calling fatal_error.
sql/sp_head.cc:
  Allocator already sets fatal error.
sql/sql_class.h:
  A error must exist for it to be fatal. Pass flag to signal fatal
  error instead of calling fatal_error.
sql/sql_insert.cc:
  Pass flag to signal fatal error instead of calling fatal_error.
sql/sql_list.h:
  Pass flag to signal fatal error instead of calling fatal_error.
sql/sql_parse.cc:
  Pass flag to signal fatal error instead of calling fatal_error.
sql/sql_partition.cc:
  Pass flag to signal fatal error instead of calling fatal_error.
sql/sql_select.cc:
  Pass flag to signal fatal error instead of calling fatal_error.
sql/sql_servers.cc:
  Use init_sql_alloc to initialize memory roots, which uses
  the sql error handler to push errors.
sql/sql_show.cc:
  Pass flag to signal fatal error instead of calling fatal_error.
sql/sql_trigger.cc:
  Use init_sql_alloc to initialize memory roots, which uses
  the sql error handler to push errors.
sql/sql_update.cc:
  Pass flag to signal fatal error instead of calling fatal_error.
sql/tztime.cc:
  Use init_sql_alloc to initialize memory roots, which uses
  the sql error handler to push errors.
2009-11-10 18:31:28 -02:00
Andrei Elkin
7eb789a723 merging 5.1 main -> 5.1-rep+2 -> 5.1-rep+3; binlog_unsafe , rpl_mysql_upgrade fail and are under treatment 2009-11-10 20:45:15 +02:00
Igor Babaev
d749c7e600 Merge 2009-11-09 18:32:39 -08:00
unknown
ad368a2b54 Merge Mysql 5.1.39 merge into MariaDB trunk 2009-11-06 18:22:32 +01:00
Mikael Ronstrom
092cf82871 Merge 2009-11-03 12:37:02 +01:00
Mikael Ronstrom
072c13d939 Merged WL#3352 into mysql-next-mr 2009-10-28 18:22:36 +01:00
Michael Widenius
056cebe61a Automatic merge with 5.1 2009-10-28 16:56:07 +02:00
Igor Babaev
90a4a3dcd7 Merge of the latest 5.1 changes. 2009-10-26 13:48:20 -07:00
Michael Widenius
5bddbc44c6 Fixed compiler warning message
- Added checking of return value for system(), freopen(), fgets() and chown()
- Ensure that calls that require a format strings gets a format string
- Other trivial things
Updated test suite results (especially for pbxt and embedded server)
Removed warning for "Invalid (old?) table or database name 'mysqld.1'" from pbxt tests
Speed up some pbxt tests by inserting begin ; commit; around "while loops with inserts"
Added mysqld startup option '--debug-flush'
Create maria_recovery.trace in data directory instead of current directory

client/mysql.cc:
  Check return value from system()
client/mysql_upgrade.c:
  Check return value from fgets()
client/mysqladmin.cc:
  Check return value from fgets()
client/mysqlslap.c:
  Check return value from system() (but ignore it, as it's not critical)
extra/yassl/src/crypto_wrapper.cpp:
  Check return value from fgets() (but ignore it, as it's internal file)
extra/yassl/taocrypt/src/aes.cpp:
  Added extra {} to remove compiler warning
extra/yassl/taocrypt/src/blowfish.cpp:
  Added extra {} to remove compiler warning
extra/yassl/taocrypt/src/misc.cpp:
  Ifdef not used code
include/mysys_err.h:
  Added error message for failing chown()
mysql-test/mysql-test-run.pl:
  Don't give warning for skipping ndbcluster (never enabled in MariaDB)
mysql-test/suite/funcs_1/r/is_columns_is_embedded.result:
  Update with new information schema information
mysql-test/suite/funcs_1/r/is_tables_is_embedded.result:
  New test
mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result:
  Update test results (has not been tested for a long time)
mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result:
  Update test results (has not been tested for a long time)
mysql-test/suite/funcs_1/t/is_tables_is.test:
  Don't run with embedded server (as results differ)
  I added a new test for embedded server
mysql-test/suite/funcs_1/t/is_tables_is_embedded.test:
  New test
mysql-test/suite/pbxt/my.cnf:
  Allow one to run pbxt tests without having to specify --mysqld=--default-storage-engine=pbxt
mysql-test/suite/pbxt/t/count_distinct3.test:
  Speed up test by inserting begin; ... commit;
mysql-test/suite/pbxt/t/subselect.test:
  Speed up test by inserting begin; ... commit;
mysys/errors.c:
  Added error message for failing chown()
mysys/my_copy.c:
  Added error message for failing chown()
mysys/my_redel.c:
  Added error message for failing chown()
mysys/safemalloc.c:
  Added cast to get rid of compiler warning
sql/ha_partition.cc:
  Fixed wrong argument to sql_print_error() (it requires a format string)
sql/log.cc:
  Test return value of freopen()
sql/mysqld.cc:
  Test return value of freopen()
  Added startup option '--debug-flush' to be used when one gets a core dump (easy to explain to people on IRC)
sql/rpl_rli.cc:
  Fixed wrong argument to sql_print_error() (it requires a format string)
sql/set_var.cc:
  Added {} to get rid of compiler warnings
sql/slave.cc:
  Fixed wrong argument to mi->report() and sql_print...() (they require a format string)
sql/sql_cache.cc:
  Fixed wrong argument to sql_printinformation() (it requires a format string)
sql/sql_parse.cc:
  Test return value of fgets()
sql/sql_plugin.cc:
  Fixed wrong argument to sql_print_error() (it requires a format string)
sql/sql_select.cc:
  Use unique table name for internal temp tables instead of full path
  (Simple speed & space optimization)
sql/udf_example.c:
  Removed compiler warning about not used variable
storage/maria/ha_maria.cc:
  Fixed wrong argument to sql_print_error() and ma_check_print_error() (they require a format string)
storage/maria/ma_recovery.c:
  Create maria_recovery.trace in data directory instead of current directory
storage/maria/unittest/ma_test_loghandler-t.c:
  Fixed wrong argument to ok();  Requires a format string
storage/pbxt/src/strutil_xt.cc:
  Detect temporary tables by checking if that path for the table is in the mysql data directory.
  The database for temporary tables is after this patch, from PBXT point of view, ""
  This is needed to stop PBXT from calling filename_to_tablename() with the base directory as an argument, which caused
  ERROR: Invalid (old?) table or database name 'mysqld.1'" in the log when running the test suite.
tests/mysql_client_test.c:
  Fixed compiler warnings
unittest/mysys/base64-t.c:
  Fixed wrong argument to diag() (it requires a format string)
  Added a comment that the current 'print' of differing buffers doesn't print the right thing,
  but didn't fix this as it's not important (unless we find a bug in the real code)
2009-10-26 13:35:42 +02:00
Alexander Nozdrin
2dc132b209 Merge from mysql-next-mr. 2009-10-23 15:22:21 +04:00
Michael Widenius
ab0905c6d7 This is based on the userstatv2 patch from Percona and OurDelta.
The original code comes, as far as I know, from Google (Mark Callaghan's team) with additional work from Percona, Ourdelta and Weldon Whipple.

This code provides the same functionallity, but with a lot of changes to make it faster and better fit the MariaDB infrastucture.

Added new status variables:
- Com_show_client_statistics, Com_show_index_statistics, Com_show_table_statistics, Com_show_user_statistics
- Access_denied_errors, Busy_time (clock time), Binlog_bytes_written, Cpu_time, Empty_queries, Rows_sent, Rows_read

Added new variable / startup option 'userstat' to control if user statistics should be enabled or not

Added my_getcputime(); Returns cpu time used by this thread.
New FLUSH commands:
- FLUSH SLOW QUERY LOG
- FLUSH TABLE_STATISTICS
- FLUSH INDEX_STATISTICS
- FLUSH USER_STATISTICS
- FLUSH CLIENT_STATISTICS

New SHOW commands:
- SHOW CLIENT_STATISTICS
- SHOW USER_STATISTICS
- SHOW TABLE_STATISTICS
- SHOW INDEX_STATISTICS

New Information schemas:
- CLIENT_STATISTICS
- USER_STATISTICS
- INDEX_STATISTICS
- TABLE_STATISTICS

Added support for all new flush commands to mysqladmin

Added handler::ha_... wrappers for all handler read calls to do statistics counting
- Changed all code to use new ha_... calls
- Count number of read rows, changed rows and rows read trough an index

Added counting of number of bytes sent to binary log (status variable Binlog_bytes_written)
Added counting of access denied errors (status variable Access_denied_erors)

Bugs fixed:
- Fixed bug in add_to_status() and add_diff_to_status() where longlong variables where threated as long
- CLOCK_GETTIME was not propely working on Linuxm

client/mysqladmin.cc:
  Added support for all new flush commmands and some common combinations:
  
  flush-slow-log
  flush-table-statistics
  flush-index-statistics
  flush-user-statistics
  flush-client-statistics
  flush-all-status
  flush-all-statistics
configure.in:
  Added checking if clock_gettime needs the librt.
  (Fixes Bug #37639 clock_gettime is never used/enabled in Linux/Unix)
include/my_sys.h:
  Added my_getcputime()
include/mysql_com.h:
  Added LIST_PROCESS_HOST_LEN & new REFRESH target defines
mysql-test/r/information_schema.result:
  New information schema tables added
mysql-test/r/information_schema_all_engines.result:
  New information schema tables added
mysql-test/r/information_schema_db.result:
  New information schema tables added
mysql-test/r/log_slow.result:
  Added testing that flosh slow query logs is accepted
mysql-test/r/status_user.result:
  Basic testing of user, client, table and index statistics
mysql-test/t/log_slow.test:
  Added testing that flosh slow query logs is accepted
mysql-test/t/status_user-master.opt:
  Ensure that we get a fresh restart before running status_user.test
mysql-test/t/status_user.test:
  Basic testing of user, client, table and index statistics
mysys/my_getsystime.c:
  Added my_getcputime()
  Returns cpu time used by this thread.
sql/authors.h:
  Updated authors to have core and original MySQL developers first.
sql/event_data_objects.cc:
  Updated call to mysql_reset_thd_for_next_command()
sql/event_db_repository.cc:
  Changed to use new ha_... calls
sql/filesort.cc:
  Changed to use new ha_... calls
sql/ha_partition.cc:
  Changed to use new ha_... calls
  Fixed comment syntax
sql/handler.cc:
  Changed to use new ha_... calls
  Reset table statistics
  Added code to update global table and index status
  Added counting of rows changed
sql/handler.h:
  Added table and index statistics variables
  Added function reset_statistics()
  Added handler::ha_... wrappers for all handler read calls to do statistics counting
  Protected all normal read calls to ensure we use the new calls in the server.
  Made ha_partition a friend class so that partition code can call the old read functions
sql/item_subselect.cc:
  Changed to use new ha_... calls
sql/lex.h:
  Added keywords for new information schema tables and flush commands
sql/log.cc:
  Added flush_slow_log()
  Added counting of number of bytes sent to binary log
  Removed not needed test of thd (It's used before, so it's safe to use)
  Added THD object to MYSQL_BIN_LOG::write_cache() to simplify statistics counting
sql/log.h:
  Added new parameter to write_cache()
  Added flush_slow_log() functions.
sql/log_event.cc:
  Updated call to mysql_reset_thd_for_next_command()
  Changed to use new ha_... calls
sql/log_event_old.cc:
  Updated call to mysql_reset_thd_for_next_command()
  Changed to use new ha_... calls
sql/mysql_priv.h:
  Updated call to mysql_reset_thd_for_next_command()
  Added new statistics functions and variables needed by these.
sql/mysqld.cc:
  Added new statistics variables and structures to handle these
  Added new status variables:
  - Com_show_client_statistics, Com_show_index_statistics, Com_show_table_statistics, Com_show_user_statistics
  - Access_denied_errors, Busy_time (clock time), Binlog_bytes_written, Cpu_time, Empty_queries, Rows_set, Rows_read
  Added new option 'userstat' to control if user statistics should be enabled or not
sql/opt_range.cc:
  Changed to use new ha_... calls
sql/opt_range.h:
  Changed to use new ha_... calls
sql/opt_sum.cc:
  Changed to use new ha_... calls
sql/records.cc:
  Changed to use new ha_... calls
sql/set_var.cc:
  Added variable 'userstat'
sql/sp.cc:
  Changed to use new ha_... calls
sql/sql_acl.cc:
  Changed to use new ha_... calls
  Added counting of access_denied_errors
sql/sql_base.cc:
  Added call to statistics functions
sql/sql_class.cc:
  Added usage of org_status_var, to store status variables at start of command
  Added functions THD::update_stats(), THD::update_all_stats()
  Fixed bug in add_to_status() and add_diff_to_status() where longlong variables where threated as long
sql/sql_class.h:
  Added new status variables to status_var
  Moved variables that was not ulong in status_var last.
  Added variables to THD for storing temporary values during statistics counting
sql/sql_connect.cc:
  Variables and functions to calculate user and client statistics
  Added counting of access_denied_errors and lost_connections
sql/sql_cursor.cc:
  Changed to use new ha_... calls
sql/sql_handler.cc:
  Changed to use new ha_... calls
sql/sql_help.cc:
  Changed to use new ha_... calls
sql/sql_insert.cc:
  Changed to use new ha_... calls
sql/sql_lex.h:
  Added SQLCOM_SHOW_USER_STATS, SQLCOM_SHOW_TABLE_STATS, SQLCOM_SHOW_INDEX_STATS, SQLCOM_SHOW_CLIENT_STATS
sql/sql_parse.cc:
  Added handling of:
  - SHOW CLIENT_STATISTICS
  - SHOW USER_STATISTICS
  - SHOW TABLE_STATISTICS
  - SHOW INDEX_STATISTICS
  Added handling of new FLUSH commands:
  - FLUSH SLOW QUERY LOGS
  - FLUSH TABLE_STATISTICS
  - FLUSH INDEX_STATISTICS
  - FLUSH USER_STATISTICS
  - FLUSH CLIENT_STATISTICS
  Added THD parameter to mysql_reset_thd_for_next_command()
  Added initialization and calls to user statistics functions
  Added increment of statistics variables empty_queries, rows_sent and access_denied_errors.
  Added counting of cpu time per query
sql/sql_plugin.cc:
  Changed to use new ha_... calls
sql/sql_prepare.cc:
  Updated call to mysql_reset_thd_for_next_command()
sql/sql_select.cc:
  Changed to use new ha_... calls
  Indentation changes
sql/sql_servers.cc:
  Changed to use new ha_... calls
sql/sql_show.cc:
  Added counting of access denied errors
  Added function for new information schema tables:
  - CLIENT_STATISTICS
  - USER_STATISTICS
  - INDEX_STATISTICS
  - TABLE_STATISTICS
  Changed to use new ha_... calls
sql/sql_table.cc:
  Changed to use new ha_... calls
sql/sql_udf.cc:
  Changed to use new ha_... calls
sql/sql_update.cc:
  Changed to use new ha_... calls
sql/sql_yacc.yy:
  Add new show and flush commands
sql/structs.h:
  Add name_length to KEY to avoid some strlen
  Added cache_name to KEY for fast storage of keyvalue in cache
  Added structs USER_STATS, TABLE_STATS, INDEX_STATS
  Added function prototypes for statistics functions
sql/table.cc:
  Store db+table+index name into keyinfo->cache_name
sql/table.h:
  Added new information schema tables
sql/tztime.cc:
  Changed to use new ha_... calls
2009-10-19 20:14:48 +03:00
Alexander Nozdrin
bd60794fd8 Merge from mysql-trunk-merge. 2009-10-19 17:36:19 +04:00
Mattias Jonsson
93e02adcfa Manual merge mysql-trunk -> mysql-trunk-wl3352 2009-10-19 12:09:52 +02:00
Igor Babaev
f7a75b999b The main commit of Andrey Zhakov's patch introducing vurtual(computed) columns.
The original patch has been ameliorated by Sanja and Igor.
2009-10-16 15:57:48 -07:00
Mikael Ronstrom
975c1ff808 Fixed review comments 2009-10-16 17:08:34 +02:00
unknown
6aad537a6a Merge MySQL 5.1.39 into MariaDB 5.1. 2009-10-15 23:38:29 +02:00
Magne Mahre
53d549483b Bug #37433 Deadlock between open_table, close_open_tables,
get_table_share, drop_open_table
            
In the partition handler code, LOCK_open and share->LOCK_ha_data
are acquired in the wrong order in certain cases.  When doing a
multi-row INSERT (i.e a INSERT..SELECT) in a table with auto-
increment column(s). the increments must be in a monotonically
continuous increasing sequence (i.e it can't have "holes"). To
achieve this, a lock is held for the duration of the operation.
share->LOCK_ha_data was used for this purpose.
            
Whenever there was a need to open a view _during_ the operation
(views are not currently pre-opened the way tables are), and
LOCK_open was grabbed, a deadlock could occur.  share->LOCK_ha_data
is other places used _while_ holding LOCK_open.
            
A new mutex was introduced in the HA_DATA_PARTITION structure,
for exclusive use of the autoincrement data fields, so we don't
need to overload the use of LOCK_ha_data here.
            
A module test case has not been supplied, since the problem occurs
as a result of a race condition, and testing for this condition 
is thus not deterministic.   Testing for it could be done by
setting up a test case as described in the bug report.
2009-10-15 13:07:04 +02:00
Alexander Nozdrin
c30d924dd5 Manual merge from mysql-trunk-merge. 2009-10-14 12:25:39 +04:00
Mattias Jonsson
ef31b39d1d merge into mysql-5.1-bugteam 2009-10-09 09:56:07 +02:00
Mattias Jonsson
62395e6ffa Bug#44059: Incorrect cardinality of indexes on a partitioned table
backport for bug#44059 from mysql-pe to mysql-5.1-bugteam

Using the partition with most rows instead of first partition
to estimate the cardinality of indexes.

mysql-test/r/partition.result:
  Bug#44059: Incorrect cardinality of indexes on a partitioned table
  
  Added test result
mysql-test/t/partition.test:
  Bug#44059: Incorrect cardinality of indexes on a partitioned table
  
  Added test case
sql/ha_partition.cc:
  Bug#44059: Incorrect cardinality of indexes on a partitioned table
  
  Checking which partition that has the most rows, and using that
  partition for HA_STATUS_CONST instead of first partition
2009-10-08 15:58:17 +02:00
Mattias Jonsson
0186334ae8 Bug#46922: crash when adding partitions and open_files_limit
is reached

Problem was bad error handling, leaving some new temporary
partitions locked and initialized and some not yet initialized
and locked, leading to a crash when trying to unlock the not
yet initialized and locked partitions

Solution was to unlock the already locked partitions, and not
include any of the new temporary partitions in later unlocks

mysql-test/r/partition_open_files_limit.result:
  Bug#46922: crash when adding partitions and open_files_limit
  is reached
  
  New test result
mysql-test/t/partition_open_files_limit-master.opt:
  Bug#46922: crash when adding partitions and open_files_limit
  is reached
  
  New test opt-file for testing when open_files_limit is reached
mysql-test/t/partition_open_files_limit.test:
  Bug#46922: crash when adding partitions and open_files_limit
  is reached
  
  New test case testing when open_files_limit is reached
sql/ha_partition.cc:
  Bug#46922: crash when adding partitions and open_files_limit
  is reached
  
  When cleaning up the partitions already locked need to be unlocked,
  and not be unlocked/closed after cleaning up.
2009-10-08 15:36:43 +02:00
Mikael Ronstrom
dc97402c11 Changed all no_ to num_ to avoid strange names like no_list_values which is not expected to be number of list values, rather a boolea indicating no list values 2009-10-01 15:04:42 +02:00
Sven Sandberg
3d467f04a1 merged fixes for BUG#39934 to 5.1-rpl+3
Also renamed current_stmt_binlog_row_based to
current_stmt_binlog_format_row for consistency
2009-09-30 18:00:22 +02:00
Mikael Ronstrom
ccae404afa Merge to mysql-next-mr 2009-09-28 09:39:50 +02:00
Staale Smedseng
6a89842e36 Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2

Cleaning up warnings not present in 5.0.
2009-09-23 15:21:29 +02:00
Anurag Shekhar
5999113f33 Bug #45840 read_buffer_size allocated for each partition when
"insert into.. select * from"

When inserting into a partitioned table using 'insert into
<target> select * from <src>', read_buffer_size bytes of memory
are allocated for each partition in the target table.

This resulted in large memory consumption when the number of
partitions are high.

This patch introduces a new method which tries to estimate the
buffer size required for each partition and limits the maximum
buffer size used to maximum of 10 * read_buffer_size, 
11 * read_buffer_size in case of monotonic partition functions.

sql/ha_partition.cc:
  Introduced a method ha_partition::estimate_read_buffer_size
  to estimate buffer size required for each partition. 
  Method ha_partition::start_part_bulk_insert updated
  to update the read_buffer_size before calling bulk upload
  in storage engines.
  Added thd in ha_partition::start_part_bulk_insert method signature.
sql/ha_partition.h:
  Introduced a method ha_partition::estimate_read_buffer_size.
  Added thd in ha_partition::start_part_bulk_insert method signature.
2009-09-17 17:35:43 +05:30
Mattias Jonsson
23dc8abe2b merge 2009-09-12 00:40:23 +02:00
Mikael Ronstrom
ec5b259543 Automerge 2009-09-10 11:18:50 +02:00
Mikael Ronstrom
d0d52e9f11 WL#4444 Added TRUNCATE partition support, fixes bug#19405 and bug #35111 2009-09-10 11:15:39 +02:00
Mikael Ronstrom
52d9a4d3d6 WL#4571, Enable Key cache defined for a partition to enable more scalability on partitioned MyISAM tables among other things 2009-09-10 11:14:23 +02:00
Sergey Petrunya
29f0dcb563 Merge MySQL->MariaDB
* Finished Monty and Jani's merge
* Some InnoDB tests still fail (because it's old xtradb code run against
  newer testsuite). They are expected to go after mergning with the latest
  xtradb.
2009-09-08 00:50:10 +04:00
Mikael Ronstrom
bdd4374445 Automerge 2009-09-07 12:22:57 +02:00
Mikael Ronstrom
dd407c5228 Fix to ensure that all subpartitions gets deleted before renaming starts, BUG#47029 2009-09-07 10:37:54 +02:00
Mattias Jonsson
35d6911b28 Bug#35845: unneccesary call to ha_start_bulk_insert for not used partitions
(Backport)

Problem is that when insert (ha_start_bulk_insert) in i partitioned table,
it will call ha_start_bulk_insert for every partition, used or not.

Solution is to delay the call to the partitions ha_start_bulk_insert until
the first row is to be inserted into that partition


sql/ha_partition.cc:
  Bug#35845: unneccesary call to ha_start_bulk_insert for not used partitions
  
  Using a bitmap for keeping record of which partitions for which
  ha_start_bulk_insert has been called, and check against that if one
  should call it before continue with the insert/update, or if it has already
  been called.
  
  This way it will only call ha_start_bulk_insert for the used partitions.
  There is also a little prediction on how many rows that will be inserted into
  the current partition, it will guess on equal distribution of the records
  across all partitions, accept for the first used partition, which will guess
  at 50% of the given estimate, if it is a monotonic partitioning function.
sql/ha_partition.h:
  Bug#35845: unneccesary call to ha_start_bulk_insert for not used partitions
  
  Added help variables and function for delaying ha_bulk_insert until it has
  to be called.
  
  Fixed a comment.
2009-09-04 15:02:15 +02:00
V Narayanan
9776b6f9cd Bug#45823 Assertion failure in file row/row0mysql.c line 1386
Inserting a negative value in the autoincrement column of a
partitioned innodb table was causing the value of the auto
increment counter to wrap around into a very large positive
value. The consequences are the same as if a very large positive
value was inserted into a column, e.g. reduced autoincrement
range, failure to read autoincrement counter.

The current patch ensures that before calculating the next
auto increment value, the current value is within the positive
maximum allowed limit.

mysql-test/suite/parts/inc/partition_auto_increment.inc:
  Bug#45823 Assertion failure in file row/row0mysql.c line 1386
  
  Adds tests for performing insert,update and delete on a partition
  table with negative auto_increment values.
mysql-test/suite/parts/r/partition_auto_increment_innodb.result:
  Bug#45823 Assertion failure in file row/row0mysql.c line 1386
  
  Result file for the innodb engine.
mysql-test/suite/parts/r/partition_auto_increment_memory.result:
  Bug#45823 Assertion failure in file row/row0mysql.c line 1386
  
  Result file for the memory engine.
mysql-test/suite/parts/r/partition_auto_increment_myisam.result:
  Bug#45823 Assertion failure in file row/row0mysql.c line 1386
  
  Result file for the myisam engine.
mysql-test/suite/parts/r/partition_auto_increment_ndb.result:
  Bug#45823 Assertion failure in file row/row0mysql.c line 1386
  
  Result file for the ndb engine.
mysql-test/suite/parts/t/partition_auto_increment_archive.test:
  Bug#45823 Assertion failure in file row/row0mysql.c line 1386
  
  Adds a variable that allows the Archive engine to skip tests
  that involve insertion of negative auto increment values.
mysql-test/suite/parts/t/partition_auto_increment_blackhole.test:
  Bug#45823 Assertion failure in file row/row0mysql.c line 1386
  
  Adds a variable that allows the Blackhole engine to skip tests
  that involve insertion of negative auto increment values.
sql/ha_partition.cc:
  Bug#45823 Assertion failure in file row/row0mysql.c line 1386
  
  Ensures that the current value is lesser than the upper limit
  for the type of the field before setting the next auto increment
  value to be calculated.
sql/ha_partition.h:
  Bug#45823 Assertion failure in file row/row0mysql.c line 1386
  
  Modifies the set_auto_increment_if_higher function, to take
  into account negative auto increment values when doing a
  comparison.
2009-09-04 09:27:11 +05:30
Mattias Jonsson
a4e832d69d Bug#46639: 1030 (HY000): Got error 124 from storage engine on
INSERT ... SELECT ...

Problem was that when bulk insert is used on an empty
table/partition, it disables the indexes for better
performance, but in this specific case it also tries
to read from that partition using an index, which is
not possible since it has been disabled.

Solution was to allow index reads on disabled indexes
if there are no records.

Also reverted the patch for bug#38005, since that was a workaround
in the partitioning engine instead of a fix in myisam.

mysql-test/r/partition.result:
  Bug#46639: 1030 (HY000): Got error 124 from storage engine on
  INSERT ... SELECT ...
  
  updated result file
mysql-test/t/partition.test:
  Bug#46639: 1030 (HY000): Got error 124 from storage engine on
  INSERT ... SELECT ...
  
  Added testcase
sql/ha_partition.cc:
  Bug#46639: 1030 (HY000): Got error 124 from storage engine on
  INSERT ... SELECT ...
  
  reverted the patch for bug#38005, since that was a workaround
  around this problem, not needed after fixing it in myisam.
storage/myisam/mi_search.c:
  Bug#46639: 1030 (HY000): Got error 124 from storage engine on
  INSERT ... SELECT ...
  
  Return HA_ERR_END_OF_FILE instead of HA_ERR_WRONG_INDEX
  when there are no rows.
2009-08-21 17:38:29 +02:00
Satya B
d933cb1669 Fix for BUG#45816 - assertion failure with index containing double
column on partitioned table
      
      
An assertion 'ASSERT_COULUMN_MARKED_FOR_READ' is failed if the query 
is executed with index containing double column on partitioned table.
The problem is that assertion expects all the fields which are read,
to be in the read_set.
      
In this query only the field 'a' is in the readset as the tables in
the query are joined by the field 'a' and so the assertion fails 
expecting other field 'b'.
      
Since the function cmp() is just comparison of two parameters passed, 
the assertion is not required.
      
Fixed by removing the assertion in the double fields comparision
function and also fixed the index initialization to do ordered
index scan with RW LOCK which ensures all the fields from a key are in
the read_set.
 

Note: this bug is not reproducible with other datatypes because the
      assertion doesn't exist in comparision function for other 
      datatypes.

mysql-test/r/partition.result:
  Testcase for BUG#45816
mysql-test/t/partition.test:
  Testcase for BUG#45816
sql/field.cc:
  Removed the assertion ASSERT_COLUMN_MARED_FOR_READ in Field_double::cmp()
  function
sql/ha_partition.cc:
  Fixed index_int() method to make it initialize the read_set properly if
  ordered index scan with RW lock is requested.
2009-08-06 17:01:26 +05:30
Tatiana A. Nurnberg
e26350e000 auto-merge 2009-07-31 21:58:40 +02:00
Tatiana A. Nurnberg
717d6054f5 Bug#40281, partitioning the general log table crashes the server
We disallow the partitioning of a log table. You could however
partition a table first, and then point logging to it. This is
not only against the docs, it also crashes the server.

We catch this case now.

mysql-test/r/partition.result:
  results for 40281
mysql-test/t/partition.test:
  test for 40281: show that trying to log to partitioned table fails rather
  to crash the server
sql/ha_partition.cc:
  Signal that we no longer support logging to partitioned tables,
  as per the docs.
sql/sql_partition.cc:
  Some commands like "USE ..." have no select, yet we may try
  to parse partition info after their execution if user set a
  partitioned table as log target. This shouldn't lead to a
  NULL-deref/crash.
2009-07-31 14:38:18 +02:00
Anurag Shekhar
0498988b48 Bug#30102: Rename table does corrupt tables with partition files on failure
Problem was that a failing rename just left the partitions at the state
it was at the failure.

Solution was to try to revert the started rename if a failure occured.

mysql-test/r/partition_not_embedded.result:
  Bug#30102: Rename table does corrupt tables with partition files on failure
  
  New result file
mysql-test/t/partition_not_embedded.test:
  Bug#30102: Rename table does corrupt tables with partition files on failure
  
  New test file
  (list_files does not report the files in embedded)
sql/ha_partition.cc:
  Bug#30102: Rename table does corrupt tables with partition files on failure
  
  Better error handling for rename partitions (reverting the started rename
  operation)
  
  Different order of files for delete.
sql/handler.cc:
  Bug#30102: Rename table does corrupt tables with partition files on failure
  
  Tries to remove as many table files as possible
  if the first delete succeeds.
2009-07-24 15:41:23 +05:30
Sven Sandberg
86a3e213ac Merged fix for BUG#39934 up a few revisions.
NOTE: This undoes changes by BUG#42829 in sql_class.cc:binlog_query().
I will revert the change in a post-push fix (the binlog filter should
be checked in sql_base.cc:decide_logging_format()).
2009-07-14 22:12:27 +02:00
Sven Sandberg
41783de549 BUG#39934: Slave stops for engine that only support row-based logging
General overview:
The logic for switching to row format when binlog_format=MIXED had
numerous flaws. The underlying problem was the lack of a consistent
architecture.
General purpose of this changeset:
This changeset introduces an architecture for switching to row format
when binlog_format=MIXED. It enforces the architecture where it has
to. It leaves some bugs to be fixed later. It adds extensive tests to
verify that unsafe statements work as expected and that appropriate
errors are produced by problems with the selection of binlog format.
It was not practical to split this into smaller pieces of work.

Problem 1:
To determine the logging mode, the code has to take several parameters
into account (namely: (1) the value of binlog_format; (2) the
capabilities of the engines; (3) the type of the current statement:
normal, unsafe, or row injection). These parameters may conflict in
several ways, namely:
 - binlog_format=STATEMENT for a row injection
 - binlog_format=STATEMENT for an unsafe statement
 - binlog_format=STATEMENT for an engine only supporting row logging
 - binlog_format=ROW for an engine only supporting statement logging
 - statement is unsafe and engine does not support row logging
 - row injection in a table that does not support statement logging
 - statement modifies one table that does not support row logging and
   one that does not support statement logging
Several of these conflicts were not detected, or were detected with
an inappropriate error message. The problem of BUG#39934 was that no
appropriate error message was written for the case when an engine
only supporting row logging executed a row injection with
binlog_format=ROW. However, all above cases must be handled.
Fix 1:
Introduce new error codes (sql/share/errmsg.txt). Ensure that all
conditions are detected and handled in decide_logging_format()

Problem 2:
The binlog format shall be determined once per statement, in
decide_logging_format(). It shall not be changed before or after that.
Before decide_logging_format() is called, all information necessary to
determine the logging format must be available. This principle ensures
that all unsafe statements are handled in a consistent way.
However, this principle is not followed:
thd->set_current_stmt_binlog_row_based_if_mixed() is called in several
places, including from code executing UPDATE..LIMIT,
INSERT..SELECT..LIMIT, DELETE..LIMIT, INSERT DELAYED, and
SET @@binlog_format. After Problem 1 was fixed, that caused
inconsistencies where these unsafe statements would not print the
appropriate warnings or errors for some of the conflicts.
Fix 2:
Remove calls to THD::set_current_stmt_binlog_row_based_if_mixed() from
code executed after decide_logging_format(). Compensate by calling the
set_current_stmt_unsafe() at parse time. This way, all unsafe statements
are detected by decide_logging_format().

Problem 3:
INSERT DELAYED is not unsafe: it is logged in statement format even if
binlog_format=MIXED, and no warning is printed even if
binlog_format=STATEMENT. This is BUG#45825.
Fix 3:
Made INSERT DELAYED set itself to unsafe at parse time. This allows
decide_logging_format() to detect that a warning should be printed or
the binlog_format changed.

Problem 4:
LIMIT clause were not marked as unsafe when executed inside stored
functions/triggers/views/prepared statements. This is
BUG#45785.
Fix 4:
Make statements containing the LIMIT clause marked as unsafe at
parse time, instead of at execution time. This allows propagating
unsafe-ness to the view.


mysql-test/extra/rpl_tests/create_recursive_construct.inc:
  Added auxiliary file used by binlog_unsafe.test to create and
  execute recursive constructs
  (functions/procedures/triggers/views/prepared statements).
mysql-test/extra/rpl_tests/rpl_foreign_key.test:
  removed unnecessary set @@session.binlog_format
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
  Filter out table id from table map events in binlog listing.
  Got rid of $binlog_format_statement.
mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test:
  disable warnings around call to unsafe procedure
mysql-test/include/rpl_udf.inc:
  Disabled warnings for code that generates warnings
  for some binlog formats. That would otherwise cause
  inconsistencies in the result file.
mysql-test/r/mysqldump.result:
  Views are now unsafe if they contain a LIMIT clause.
  That fixed BUG#45831. Due to BUG#45832, a warning is
  printed for the CREATE VIEW statement.
mysql-test/r/sp_trans.result:
  Unsafe statements in stored procedures did not give a warning if
  binlog_format=statement. This is BUG#45824. Now they do, so this
  result file gets a new warning.
mysql-test/suite/binlog/r/binlog_multi_engine.result:
  Error message changed.
mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result:
  INSERT DELAYED didn't generate a warning when binlog_format=STATEMENT.
  That was BUG#45825. Now there is a warning, so result file needs to be
  updated.
mysql-test/suite/binlog/r/binlog_stm_ps.result:
  Changed error message.
mysql-test/suite/binlog/r/binlog_unsafe.result:
  updated result file:
   - error message changed
   - added test for most combinations of unsafe constructs invoked
     from recursive constructs
   - INSERT DELAYED now gives a warning (because BUG#45826 is fixed)
   - INSERT..SELECT..LIMIT now gives a warning from inside recursive
     constructs (because BUG#45785 was fixed)
   - When a recursive construct (e.g., stored proc or function)
     contains more than one statement, at least one of which is
     unsafe, then all statements in the recursive construct give
     warnings. This is a new bug introduced by this changeset.
     It will be addressed in a post-push fix.
mysql-test/suite/binlog/t/binlog_innodb.test:
  Changed error code for innodb updates with READ COMMITTED or 
  READ UNCOMMITTED transaction isolation level and
  binlog_format=statement.
mysql-test/suite/binlog/t/binlog_multi_engine.test:
  The error code has changed for statements where more than one
  engine is involved and one of them is self-logging.
mysql-test/suite/binlog/t/binlog_unsafe-master.opt:
  Since binlog_unsafe now tests unsafe-ness of UDF's, we need an extra
  flag in the .opt file.
mysql-test/suite/binlog/t/binlog_unsafe.test:
   - Clarified comment.
   - Rewrote first part of test. Now it tests not only unsafe variables
     and functions, but also unsafe-ness due to INSERT..SELECT..LIMIT,
     INSERT DELAYED, insert into two autoinc columns, use of UDF's, and
     access to log tables in the mysql database.
     Also, in addition to functions, procedures, triggers, and prepared
     statements, it now also tests views; and it constructs recursive
     calls in two levels by combining these recursive constructs.
     Part of the logic is in extra/rpl_tests/create_recursive_construct.inc.
   - added tests for all special system variables that should not be unsafe.
   - added specific tests for BUG#45785 and BUG#45825
mysql-test/suite/rpl/r/rpl_events.result:
  updated result file
mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result:
  updated result file
mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result:
  updated result file
mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result:
  updated result file
mysql-test/suite/rpl/r/rpl_idempotency.result:
  updated result file
mysql-test/suite/rpl/r/rpl_mix_found_rows.result:
  Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and
  rpl_stm_found_rows.test (renamed rpl_found_rows.test). This file equals
  the second half of the old rpl_found_rows.result, with the following
  modifications:
   - minor formatting changes
   - additional initialization
mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result:
  Moved out code operating in mixed mode from rpl_stm_insert_delayed
  (into rpl_mix_insert_delayed) and got rid of explicit setting of
  binlog format.
mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result:
  updated result file
mysql-test/suite/rpl/r/rpl_row_idempotency.result:
  Moved the second half of rpl_idempotency.test, which only
  executed in row mode, to rpl_row_idempotency.test. This is
  the new result file.
mysql-test/suite/rpl/r/rpl_row_insert_delayed.result:
  Got rid of unnecessary explicit setting of binlog format.
mysql-test/suite/rpl/r/rpl_stm_found_rows.result:
  Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and
  rpl_stm_found_rows.test (renamed rpl_found_rows.test). Changes in
  this file:
   - minor formatting changes
   - warning is now issued for unsafe statements inside procedures
     (since BUG#45824 is fixed)
   - second half of file is moved to rpl_mix_found_rows.result
mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result:
  Moved out code operating in mixed mode from rpl_stm_insert_delayed
  (into rpl_mix_insert_delayed) and got rid of explicit setting of
  binlog format.
mysql-test/suite/rpl/r/rpl_stm_loadfile.result:
  error message changed
mysql-test/suite/rpl/r/rpl_temporary_errors.result:
  updated result file
mysql-test/suite/rpl/r/rpl_udf.result:
  Remove explicit set of binlog format (and triplicate test execution)
  and rely on test system executing the test in all binlog formats.
mysql-test/suite/rpl/t/rpl_bug31076.test:
  Test is only valid in mixed or row mode since it generates row events.
mysql-test/suite/rpl/t/rpl_events.test:
  Removed explicit set of binlog_format and removed duplicate testing.
  Instead, we rely on the test system to try all binlog formats.
mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test:
  Removed triplicate testing and instead relying on test system.
  Test is only relevant for row format since statement-based replication
  cannot handle extra columns on master.
mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test:
  Removed triplicate testing and instead relying on test system.
  Test is only relevant for row format since statement-based replication
  cannot handle extra columns on master.
mysql-test/suite/rpl/t/rpl_idempotency-slave.opt:
  Removed .opt file to avoid server restarts.
mysql-test/suite/rpl/t/rpl_idempotency.test:
  - Moved out row-only tests to a new test file, rpl_row_idempotency.test.
    rpl_idempotency now only contains tests that execute in all
    binlog_formats.
  - While I was here, also removed .opt file to avoid server restarts.
    The slave_exec_mode is now set inside the test instead.
mysql-test/suite/rpl/t/rpl_mix_found_rows.test:
  Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and
  rpl_stm_found_rows.test (renamed rpl_found_rows.test). This file
  contains the second half of the original rpl_found_rows.test with the
  follwing changes:
   - initialization
   - removed SET_BINLOG_FORMAT and added have_binlog_format_mixed.inc
   - minor formatting changes
mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test:
  Moved out code operating in mixed mode from rpl_stm_insert_delayed
  (into rpl_mix_insert_delayed) and got rid of explicit setting of
  binlog format.
mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test:
  Test cannot execute in statement mode, since we no longer
  switch to row format when binlog_format=statement.
  Enforced mixed mode throughout the test.
mysql-test/suite/rpl/t/rpl_row_idempotency.test:
  Moved the second half of rpl_idempotency.test, which only
  executed in row mode, to this new file. We now rely on the
  test system to set binlog format.
mysql-test/suite/rpl/t/rpl_row_insert_delayed.test:
   - Got rid of unnecessary explicit setting of binlog format.
   - extra/rpl_tests/rpl_insert_delayed.test does not need the
     $binlog_format_statement variable any more, so that was
     removed.
mysql-test/suite/rpl/t/rpl_slave_skip.test:
  The test switches binlog_format internally and master generates both
  row and statement events. Hence, the slave must be able to log in both
  statement and row format. Hence test was changed to only execute in
  mixed mode.
mysql-test/suite/rpl/t/rpl_stm_found_rows.test:
  Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and
  rpl_stm_found_rows.test (renamed rpl_found_rows.test). Changes in
  this file:
   - minor formatting changes
   - added have_binlog_format_statement and removed SET BINLOG_FORMAT.
   - second half of file is moved to rpl_mix_found_rows.test
   - added cleanup code
mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test:
  Moved out code operating in mixed mode from rpl_stm_insert_delayed
  (into rpl_mix_insert_delayed) and got rid of explicit setting of
  binlog format.
mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test:
  The test switches binlog_format internally and master generates both
  row and statement events. Hence, the slave must be able to log in both
  statement and row format. Hence test was changed to only execute in
  mixed mode on slave.
mysql-test/suite/rpl/t/rpl_temporary_errors.test:
  Removed explicit set of binlog format. Instead, the test now only
  executes in row mode.
mysql-test/suite/rpl/t/rpl_udf.test:
  Remove explicit set of binlog format (and triplicate test execution)
  and rely on test system executing the test in all binlog formats.
mysql-test/suite/rpl_ndb/combinations:
  Added combinations file for rpl_ndb.
mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result:
  new result file
mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result:
  updated result file
mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-master.opt:
  new option file
mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-slave.opt:
  new option file
mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test:
  New test case to verify all errors and warnings generated by
  decide_logging_format.
mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
  While I was here, also made the test clean up after itself.
mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test:
  The test needs slave to be able to switch to row mode, so the
  test was changed to only execute in mixed and row mode.
mysql-test/t/partition_innodb_stmt.test:
  Changed error code for innodb updates with READ COMMITTED or 
  READ UNCOMMITTED transaction isolation level and
  binlog_format=statement.
sql/event_db_repository.cc:
  Use member function to read current_stmt_binlog_row_based.
sql/events.cc:
  Use member function to read current_stmt_binlog_row_based.
sql/ha_ndbcluster_binlog.cc:
  reset_current_stmt_binlog_row_based() is not a no-op for the ndb_binlog
  thread any more. Instead, the ndb_binlog thread now forces row mode both
  initially and just after calling mysql_parse.  (mysql_parse() is the only
  place where reset_current_stmt_binlog_row_based() may be called from
  the ndb_binlog thread, so these are the only two places that need to
  change.)
sql/ha_partition.cc:
  Use member function to read current_stmt_binlog_row_based.
sql/handler.cc:
  Use member function to read current_stmt_binlog_row_based.
sql/item_create.cc:
  Added DBUG_ENTER to some functions, to be able to trace when
  set_stmt_unsafe is called.
sql/log.cc:
  Use member function to read current_stmt_binlog_row_based.
sql/log_event.cc:
   - Moved logic for changing to row format out of do_apply_event (and into
     decide_logging_format).
   - Added @todo comment for post-push cleanup.
sql/log_event_old.cc:
  Move logic for changing to row format out of do_apply_event (and into
  decide_logging_format).
sql/mysql_priv.h:
  Make decide_logging_format() a member of the THD class, for two reasons:
   - It is natural from an object-oriented perspective.
   - decide_logging_format() needs to access private members of THD
     (specifically, the new binlog_warning_flags field).
sql/rpl_injector.cc:
  Removed call to set_current_stmt_binlog_row_based().
  From now on, only decide_logging_fromat is allowed to modify
  current_stmt_binlog_row_based. This call is from the ndb_binlog
  thread, mostly executing code in ha_ndbcluster_binlog.cc.
  This call can be safely removed, because:
   - current_stmt_binlog_row_based is initialized for the ndb_binlog
     thread's THD object when the THD object is created. So we're
     not going to read uninitialized memory.
   - The behavior of ndb_binlog thread does not use the state of the
     current_stmt_binlog_row_based. It is conceivable that the
     ndb_binlog thread would rely on the current_stmt_binlog_format
     in two situations:
      (1) when it calls mysql_parse;
      (2) when it calls THD::binlog_query.
     In case (1), it always clears THD::options&OPTION_BIN_LOG (because
     run_query() in ha_ndbcluster_binlog.cc is only called with
     disable_binlogging = TRUE).
     In case (2), it always uses qtype=STMT_QUERY_TYPE.
sql/set_var.cc:
  Added @todo comment for post-push cleanup.
sql/share/errmsg.txt:
  Added new error messages and clarified ER_BINLOG_UNSAFE_STATEMENT.
sql/sp.cc:
  Added DBUG_ENTER, to be able to trace when set_stmt_unsafe is called.
  Got rid of MYSQL_QUERY_TYPE: it was equivalent to STMT_QUERY_TYPE.
sql/sp_head.cc:
  Use member function to read current_stmt_binlog_row_based.
sql/sp_head.h:
  Added DBUG_ENTER, to be able to trace when set_stmt_unsafe is called.
sql/sql_acl.cc:
  Got rid of MYSQL_QUERY_TYPE: it was equivalent to STMT_QUERY_TYPE.
sql/sql_base.cc:
   - Made decide_logging_format take care of all logic for deciding the
     logging format, and for determining the related warnings and errors.
     See comment above decide_logging_format for details.
   - Made decide_logging_format a member function of THD, since it needs
     to access private members of THD and since its purpose is to update
     the state of a THD object.
   - Added DBUG_ENTER, to be able to trace when set_stmt_unsafe is called.
sql/sql_class.cc:
  - Moved logic for determining unsafe warnings away from THD::binlog_query
    (and into decide_logging_format()). Now, it works like this:
    1. decide_logging_format detects that the current statement shall
       produce a warning, if it ever makes it to the binlog
    2. decide_logging_format sets a flag of THD::binlog_warning_flags.
    3. THD::binlog_query reads the flag. If the flag is set, it generates
       a warning.
  - Use member function to read current_stmt_binlog_row_based.
sql/sql_class.h:
  - Added THD::binlog_warning_flags (see sql_class.cc for explanation).
  - Made decide_logging_format() and reset_for_next_command() member
    functions of THD (instead of standalone functions). This was needed
    for two reasons: (1) the functions need to access the private member
    THD::binlog_warning_flags; (2) the purpose of these functions is to
    update the staet of a THD object, so from an object-oriented point
    of view they should be member functions.
  - Encapsulated current_stmt_binlog_row_based, so it is now private and
    can only be accessed from a member function. Also changed the
    data type to an enumeration instead of a bool.
  - Removed MYSQL_QUERY_TYPE, because it was equivalent to
    STMT_QUERY_TYPE anyways.
  - When reset_current_stmt_binlog_row_based was called from the
    ndb_binlog thread, it would behave as a no-op. This special
    case has been removed, and the behavior of
    reset_current_stmt_binlog_row_based does not depend on which thread
    calls it any more. The special case did not serve any purpose,
    since the ndb binlog thread did not take the
    current_stmt_binlog_row_based flag into account anyways.
sql/sql_delete.cc:
  - Moved logic for setting row format for DELETE..LIMIT away from
    mysql_prepare_delete.
    (Instead, we mark the statement as unsafe at parse time (sql_yacc.yy)
    and rely on decide_logging_format() (sql_class.cc) to set row format.)
    This is part of the fix for BUG#45831.
  - Use member function to read current_stmt_binlog_row_based.
sql/sql_insert.cc:
   - Removed unnecessary calls to thd->lex->set_stmt_unsafe() and
     thd->set_current_stmt_binlog_row_based_if_mixed() from
     handle_delayed_insert(). The calls are unnecessary because they
     have already been made; they were made in the constructor of
     the `di' object.
   - Since decide_logging_format() is now a member function of THD, code
     that calls decide_logging_format() had to be updated.
   - Added DBUG_ENTER call, to be able to trace when set_stmt_unsafe is
     called.
   - Moved call to set_stmt_unsafe() for INSERT..SELECT..LIMIT away from
     mysql_insert_select_prepare() (and into decide_logging_format).
     This is part of the fix for BUG#45831.
   - Use member function to read current_stmt_binlog_row_based.
sql/sql_lex.h:
   - Added the flag BINLOG_STMT_FLAG_ROW_INJECTION to enum_binlog_stmt_flag.
     This was necessary so that a statement can identify itself as a row
     injection.
   - Added appropriate setter and getter functions for the new flag.
   - Added or clarified some comments.
   - Added DBUG_ENTER()
sql/sql_load.cc:
  Use member function to read current_stmt_binlog_row_based.
sql/sql_parse.cc:
   - Made mysql_reset_thd_for_next_command() clear thd->binlog_warning_flags.
   - Since thd->binlog_warning_flags is private, it must be set in a
     member function of THD. Hence, moved the body of
     mysql_reset_thd_for_next_command() to the new member function
     THD::reset_thd_for_next_command(), and made
     mysql_reset_thd_for_next_command() call
     THD::reset_thd_for_next_command().
   - Removed confusing comment.
   - Use member function to read current_stmt_binlog_row_based.
sql/sql_repl.cc:
  Use member function to read current_stmt_binlog_row_based.
sql/sql_table.cc:
  Use member function to read current_stmt_binlog_row_based.
sql/sql_udf.cc:
  Use member function to read current_stmt_binlog_row_based.
sql/sql_update.cc:
  Moved logic for setting row format for UPDATE..LIMIT away from
  mysql_prepare_update.
  (Instead, we mark the statement as unsafe at parse time (sql_yacc.yy)
  and rely on decide_logging_format() (sql_class.cc) to set row format.)
  This is part of the fix for BUG#45831.
sql/sql_yacc.yy:
  Made INSERT DELAYED, INSERT..SELECT..LIMIT, UPDATE..LIMIT, and
  DELETE..LIMIT mark themselves as unsafe at parse time (instead
  of at execution time).
  This is part of the fixes BUG#45831 and BUG#45825.
storage/example/ha_example.cc:
  Made exampledb accept inserts. This was needed by the new test case
  rpl_ndb_binlog_format_errors, because it needs an engine that
  is statement-only (and accepts inserts).
storage/example/ha_example.h:
  Made exampledb a statement-only engine instead of a row-only engine.
  No existing test relied exampledb's row-only capabilities. The new
  test case rpl_ndb_binlog_format_errors needs an engine that is
  statement-only.
storage/innobase/handler/ha_innodb.cc:
  - Changed error error code and message given by innodb when 
    binlog_format=STATEMENT and transaction isolation level is
    READ COMMITTED or READ UNCOMMITTED.
  - While I was here, also simplified the condition for
    checking when to give the error.
2009-07-14 21:31:19 +02:00
Satya B
02e70f1691 Bug#35111 - Truncate a MyISAM partitioned table does not reset
the auto_increment value
      
This is an alternative patch that instead of allowing RECREATE TABLE
on TRUNCATE TABLE it implements reset_auto_increment that is called
after delete_all_rows.

Note: this bug was fixed by Mattias Jonsson:
Pusing this patch: http://lists.mysql.com/commits/70370


mysql-test/suite/parts/r/partition_auto_increment_memory.result:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
mysql-test/suite/parts/r/partition_auto_increment_myisam.result:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
sql/ha_partition.cc:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
  
  Added reset_auto_increment, to be used after delete_all_rows
  to simulate truncate.
storage/heap/ha_heap.cc:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
  
  Added reset_auto_increment, to be used after delete_all_rows
  to simulate truncate
storage/heap/ha_heap.h:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
  
  Added reset_auto_increment, to be used after delete_all_rows
  to simulate truncate
storage/myisam/ha_myisam.cc:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
  
  Added reset_auto_increment, to be used after delete_all_rows
  to simulate truncate.
storage/myisam/ha_myisam.h:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
  
  Added reset_auto_increment, to be used after delete_all_rows
  to simulate truncate.
2009-07-08 17:41:34 +05:30
Michael Widenius
224108a19e Fixed problems in merge
mysql-test/r/information_schema.result:
  Fixed a result file.
mysql-test/r/innodb-autoinc.result:
  Fixed a result file.
mysql-test/t/connect.test:
  Fixed a problem with merge, needed to close
  connections and use the default
2009-05-19 12:28:05 +03:00
unknown
b125770aaa We are now using Valgrind rather than purify, and have for quite some time.
Consequently, rename HAVE_purify to HAVE_valgrind, and related changes.
Leave some comments about purify when not clear that they apply also to Valgrind.
Fix redundant IF_VALGRIND declaration.

Misc. small fixes:
 - Fixes for pool-of-threads patch.
 - Fixes for push of PBXT storage engine.
 - mysql-test-run.pl fix.
 - Fix build problem in compile-pentium64-max.


BUILD/SETUP.sh:
  Rename purify -> valgrind.
BUILD/build_mccge.sh:
  Rename purify -> valgrind.
BUILD/compile-dist:
  Fix that PBXT was missing in source tarball after `BUILD/compile-dist && make dist`
BUILD/compile-pentium64-max:
  Fix a build problem with BUILD/compile-pentium64-max on CentOS/Fedora Core 10 amd64.
        
  On these systems, there is libz.so but no libz.a. Finding libz.so, ./configure decides
  to use system zlib. But since BUILD/compile-pentium64-max builds a fully static binary
  with -all-static, the link of mysqld fails due to missing libz.a.
        
  Fix by using bundled zlib in the build script.
BUILD/compile-solaris-sparc-purify:
  Rename purify -> valgrind.
include/m_string.h:
  Rename purify -> valgrind.
include/my_global.h:
  Rename purify -> valgrind.
mysql-test/Makefile.am:
  Fix that PBXT test suite was missing from `make dist` source tarball.
mysql-test/lib/mtr_unique.pm:
  Better fix to avoid races when chmod'ing the semaphore file.
  (Though using chmod 666 shared files in /tmp/ is still not a very good solution).
mysql-test/t/pool_of_threads.cnf:
  Fix that test case pool_of_threads fails if run on mysqld with no --with-libevent support.
mysys/mf_qsort.c:
  Rename purify -> valgrind.
mysys/my_alloc.c:
  Rename purify -> valgrind.
mysys/my_init.c:
  Rename purify -> valgrind.
mysys/my_rnd.c:
  Rename purify -> valgrind.
mysys/safemalloc.c:
  Rename purify -> valgrind.
scripts/mysql_config.pl.in:
  Rename purify -> valgrind.
scripts/mysql_config.sh:
  Rename purify -> valgrind.
sql/field_conv.cc:
  Rename purify -> valgrind.
sql/filesort.cc:
  Rename purify -> valgrind.
sql/ha_partition.cc:
  Rename purify -> valgrind.
sql/hostname.cc:
  Rename purify -> valgrind.
sql/item_timefunc.cc:
  Rename purify -> valgrind.
sql/log_event.cc:
  Rename purify -> valgrind.
sql/log_event_old.cc:
  Rename purify -> valgrind.
sql/my_decimal.h:
  Rename purify -> valgrind.
sql/mysqld.cc:
  Rename purify -> valgrind.
  Fix redundant IF_VALGRIND declaration.
sql/opt_range.cc:
  Rename purify -> valgrind.
sql/opt_range.h:
  Rename purify -> valgrind.
sql/records.cc:
  Rename purify -> valgrind.
sql/rpl_rli.cc:
  Rename purify -> valgrind.
sql/rpl_rli.h:
  Rename purify -> valgrind.
sql/set_var.cc:
  Fix missing static declaration on pool_of_threads.
sql/slave.cc:
  Rename purify -> valgrind.
sql/sql_base.cc:
  Rename purify -> valgrind.
sql/sql_binlog.cc:
  Rename purify -> valgrind.
sql/sql_class.cc:
  Rename purify -> valgrind.
sql/sql_list.h:
  Rename purify -> valgrind.
sql/sql_load.cc:
  Rename purify -> valgrind.
sql/sql_select.cc:
  Rename purify -> valgrind.
sql/table.cc:
  Rename purify -> valgrind.
storage/archive/azio.c:
  Rename purify -> valgrind.
storage/innobase/buf/buf0buf.c:
  Rename purify -> valgrind.
storage/innobase/include/univ.i:
  Rename purify -> valgrind.
storage/innobase/srv/srv0start.c:
  Rename purify -> valgrind.
storage/maria/ha_maria.cc:
  Rename purify -> valgrind.
storage/maria/ma_blockrec.c:
  Rename purify -> valgrind.
storage/maria/ma_check.c:
  Rename purify -> valgrind.
storage/maria/ma_loghandler.c:
  Rename purify -> valgrind.
storage/maria/ma_packrec.c:
  Rename purify -> valgrind.
storage/maria/ma_page.c:
  Rename purify -> valgrind.
storage/maria/ma_pagecrc.c:
  Rename purify -> valgrind.
storage/maria/ma_search.c:
  Rename purify -> valgrind.
storage/myisam/mi_check.c:
  Rename purify -> valgrind.
storage/myisam/mi_page.c:
  Rename purify -> valgrind.
storage/myisam/mi_search.c:
  Rename purify -> valgrind.
storage/myisammrg/ha_myisammrg.cc:
  Rename purify -> valgrind.
strings/bcmp.c:
  Rename purify -> valgrind.
strings/decimal.c:
  Rename purify -> valgrind.
strings/strmake.c:
  Rename purify -> valgrind.
2009-05-06 14:03:24 +02:00
Michael Widenius
210a412522 bzr merge from guilhem's maria tree to our local 5.1
configure.in:
  Manually merged
mysql-test/lib/My/ConfigFactory.pm:
  Manually merged
mysql-test/mysql-test-run.pl:
  Manually merged
mysql-test/t/information_schema.test:
  Manually merged
sql/handler.cc:
  Manually merged
support-files/mysql.spec.sh:
  Manually merged
2009-04-25 12:04:38 +03:00
Guilhem Bichot
c71aae73f6 merge of 5.1-main into 5.1-maria. MyISAM changes are propagated to Maria except
those of davi.arnaut@sun.com-20090219210935-9vilvcisyyieffxl (TODO).
2009-04-01 11:34:52 +02:00
Mattias Jonsson
e7e5443a01 Backport of patch for bug#40003 from 6.0 to 5.1,
related to the backport of the patch for bug#38719

sql/ha_partition.cc:
  bug#40003, archive does not handle dup_key.
2009-02-20 16:56:32 +01:00
Michael Widenius
a8fdaa6f2c Merge with base MySQL 5.1
Contains fixes for test cases
Changed release tag to beta

configure.in:
  change release tag to beta
2009-02-15 12:58:34 +02:00
Guilhem Bichot
704b4845aa merge of 5.1-main into 5.1-maria. Myisam->Maria change propagation will follow.
There were so many changes into mtr (this is the new mtr coming) that I rather
copied mtr from 6.0-main here (at least this one knows how to run Maria tests).
I also fixed suite/maria tests to be accepted by the new mtr.

mysys/thr_mutex.c:
  adding DBUG_PRINT here, so that we can locate where the warning is issued.
2009-02-12 15:08:56 +01:00
Michael Widenius
115efe100d Merge with old maria tree 2009-02-01 14:02:29 +02:00
Mattias Jonsson
50c10a187b merge 2009-01-07 23:30:10 +01:00
Georgi Kodinov
f97ef7a40e merged 5.1-main -> 5.1-bugteam 2009-01-05 18:10:20 +02:00
Mattias Jonsson
dc9c5440e3 Bug#36312: InnoDB DATA_FREE BUG?
Problem is that DATA_FREE in SHOW TABLE STATUS
is not correct when not using innodb_file_per_table.

The solution is to use I_S.PARTITIONS instead.

This is only a small fix for correcting mean record length and
always return 0 if the table is empty.

sql/ha_partition.cc:
  Bug#36312: InnoDB DATA_FREE BUG?
  
  This is only a small fix for correcting mean record length and
  always return 0 if the table is empty.
2008-12-19 09:23:15 +01:00
Mattias Jonsson
23d569edce post push fix for bug#40595
Addition of hander function was_semi_consistent_read

mysql-test/r/partition_innodb_semi_consistent.result:
  post push fix for bug#40595
  Addition of hander function was_semi_consistent_read
  
  Added test result
mysql-test/t/partition_innodb_semi_consistent-master.opt:
  post push fix for bug#40595
  Addition of hander function was_semi_consistent_read
  
  Added test opt file
mysql-test/t/partition_innodb_semi_consistent.test:
  post push fix for bug#40595
  Addition of hander function was_semi_consistent_read
  
  Added test case
sql/ha_partition.cc:
  post push fix for bug#40595
  Addition of hander function was_semi_consistent_read
  
  The lack of was_semi_consistent_read opened a regression
  for bug-31310 when useing a partitioned InnoDB table
2008-12-16 12:44:18 +01:00
Joerg Bruehe
2181c95918 Merge main 5.1 into 5.1-build 2008-12-10 21:14:50 +01:00
Guilhem Bichot
926aaf4635 Merge of 5.1-main into 5.1-maria. There were no changes to storage/myisam, mysys/mf_keycache.c, mysql-test/t/*myisam*
since previous merge. MARIA_PAGECACHE_READS in maria-preload.test are down a little bit (5%), which must be a good
side-effect of some sql/ change.
2008-12-10 10:02:25 +01:00
Mattias Jonsson
8adc9d1b86 Bug#40515: Query on a partitioned table does not return
'lock wait timeout exceeded'

Problem was a bug in the implementation of scan in partitioning
which masked the error code from the partition's handler.

Fixed by returning the value from the underlying handler.

mysql-test/suite/parts/r/partition_special_innodb.result:
  Bug#40515: Query on a partitioned table does not return
  'lock wait timeout exceeded'
  
  Updated test result
mysql-test/suite/parts/t/partition_special_innodb.test:
  Bug#40515: Query on a partitioned table does not return
  'lock wait timeout exceeded'
  
  Updated test case for covering the bug.
sql/ha_partition.cc:
  Bug#40515: Query on a partitioned table does not return
  'lock wait timeout exceeded'
  
  Removing redeclaration of result variable,
  which resulted in never returning the correct return value.
2008-12-04 10:47:25 +01:00
unknown
96e0bf50d9 Merge from mysql-5.1.30-release 2008-11-27 00:02:10 +01:00
Guilhem Bichot
3c1e153a82 Manually applying the patch for BUG40954 "Crash in MyISAM index code with concurrency test using partitioned tables"
so that it stops crashing pushbuild2/5.1-maria and we can see the other failures which it hid.

mysql-test/r/partition.result:
  Manually applying the patch for BUG40954 "Crash in MyISAM index code with concurrency test using partitioned tables"
mysql-test/t/partition.test:
  Manually applying the patch for BUG40954 "Crash in MyISAM index code with concurrency test using partitioned tables"
sql/ha_partition.cc:
  Manually applying the patch for BUG40954 "Crash in MyISAM index code with concurrency test using partitioned tables"
2008-11-25 10:05:48 +01:00
Build Team
74b3540919 mysql-test/r/partition.result
mysql-test/t/partition.test
sql/ha_partition.cc
  Bug#40954: Crash in MyISAM index code with concurrency test using partitioned tables
  Problem was usage of read_range_first with an empty key.
  Solution was to not to give a key if it was empty. (real author Mattias Jonsson)

storage/archive/archive_reader.c
client/mysqlslap.c
  Aligned the copyright texts output from "--version" of tools, to
  let internal tools be able to change them if needed.

storage/ndb/test/tools/connect.cpp
storage/ndb/test/run-test/atrt.hpp
  Corrected a few GPL headers not restricted to GPL version 2

Makefile.am
  Added missing --report-features to the 'test-bt-fast' target

support-files/mysql.spec.sh
  Reversed the removal of the "%define license GPL" in as internal
  tools depended on it
2008-11-25 03:04:58 +01:00
Mattias Jonsson
d5057740a0 Bug#40954: Crash in MyISAM index code with concurrency test using partitioned tables
Problem was usage of read_range_first with an empty key.

Solution was to not to give a key if it was empty.

mysql-test/r/partition.result:
  Bug#40954: Crash in MyISAM index code with concurrency test using partitioned tables
  
  Updated test result.
mysql-test/t/partition.test:
  Bug#40954: Crash in MyISAM index code with concurrency test using partitioned tables
  
  Added test case
2008-11-24 17:24:03 +01:00
Guilhem Bichot
33b194c36e Merge of 5.1-main into 5.1-maria. There were no changes to storage/myisam, or mysql-test/t/*myisam*.
However there were three new tests mysql-test/suite/parts/t/partition*myisam.test, of which I make here
copies for Maria.
2008-11-21 15:21:50 +01:00
Build Team
e85fe79430 Added "Sun Microsystems, Inc." to copyright headers on files modified
since Oct 1st
2008-11-10 21:21:49 +01:00
Mattias Jonsson
a5ec6953e1 Bug#40595: Non-matching rows not released with READ-COMMITTED
on tables with partitions

Problem was that the handler function try_semi_consistent_read
was not propagated to the innodb handler.

Solution was to implement that function in the partitioning
handler.

mysql-test/r/partition_innodb.result:
  Bug#40595: Non-matching rows not released with READ-COMMITTED
  on tables with partitions
  
  Updated test result.
mysql-test/t/partition_innodb.test:
  Bug#40595: Non-matching rows not released with READ-COMMITTED
  on tables with partitions
  
  Added test case for bug#40595.
  
  Note: the replace_regex is taking long time. I have not found
  any better regex (it takes time using 'sed' too).
sql/ha_partition.cc:
  Bug#40595: Non-matching rows not released with READ-COMMITTED
  on tables with partitions
  
  Added function to the partitioning handler for handling
  semi consistent reads (unlock_row was already implemented,
  and this is needed for unlock_row to work properly in innodb).
  It uses pruning for optimizing the call.
sql/ha_partition.h:
  Bug#40595: Non-matching rows not released with READ-COMMITTED
  on tables with partitions
  
  Added function to the partitioning handler for handling
  semi consistent reads (unlock_row was already implemented,
  and this is needed for unlock_row to work properly in innodb).
2008-11-10 21:13:24 +01:00
Georgi Kodinov
6cae4c33d0 merged 5.1-bugteam -> merge-5.1-bugteam 2008-11-06 16:24:59 +02:00
Georgi Kodinov
05dbb26dfc merged 5.1 main -> 5.1-bugteam 2008-11-06 16:18:25 +02:00
Mattias Jonsson
e337639daa post push fix, removing dbug_print due to compiler warning 2008-11-06 13:47:41 +01:00
Mattias Jonsson
8a544f2a73 merge 2008-11-05 21:13:54 +01:00
Mattias Jonsson
7c5d066b39 merge 2008-11-05 20:44:19 +01:00
Mattias Jonsson
bcd88c9f9e Bug#40494: MYSQL server crashes on range access with partitioning and
order by

Problem was that the first index read was unordered,
and the next was ordered, resulting in use of
uninitialized data.

Solution was to use the correct variable to see if
the 'next' call should be ordered or not.

mysql-test/r/partition.result:
  Bug#40494: MYSQL server crashes on range access with
  partitioning and order by
  
  Added test case for the bug.
mysql-test/t/partition.test:
  Bug#40494: MYSQL server crashes on range access with
  partitioning and order by
  
  Added test case for the bug.
sql/ha_partition.cc:
  Bug#40494: MYSQL server crashes on range access with
  partitioning and order by
  
  Used the wrong variable to decide to continue with
  ordered or unordered scan.
2008-11-05 15:53:28 +01:00
Mattias Jonsson
8dd07d32c9 merge 2008-11-04 08:55:43 +01:00
Mattias Jonsson
ea0fab9baf post-push fix for build warnings 2008-10-30 09:25:25 +01:00
Mattias Jonsson
58d2372b15 merge 2008-10-29 23:01:41 +01:00
Mattias Jonsson
fc74c4d9e5 merge 2008-10-29 21:30:04 +01:00
Mattias Jonsson
b72d1507db Bug#39084: Getting intermittent errors with statement-based binary logging
Problem was that partitioning cached the table flags.
These flags could change due to TRANSACTION LEVEL changes.
Solution was to remove the cache and always return the table flags
from the first partition (if the handler was initialized).

mysql-test/r/partition_innodb_stmt.result:
  Bug#39084: Getting intermittent errors with statement-based binary logging
  
  New test result file.
mysql-test/t/partition_innodb_stmt.test:
  Bug#39084: Getting intermittent errors with statement-based binary logging
  
  New test file.
sql/ha_partition.cc:
  Bug#39084: Getting intermittent errors with statement-based binary logging
  
  Removed m_table_flags, and added m_handler_status.
  Added checks that all partitions have the same
  table flags.
  Moved some variable initializations.
  Updated some comments.
  Fixed typo initialise -> initialize
  Changed HA_EXTTA_NO_READCHECK to do nothing, since it
  is only used in ha_open, which is called for every
  partition in ::open anyway.
sql/ha_partition.h:
  Bug#39084: Getting intermittent errors with statement-based binary logging
  
  Removed m_table_flags, and added m_handler_status.
  Always return the first partitions table flags, instead of using
  cached table flags.
  Added define of enabled/disabled partitioning table flags
  Fixed type initialise -> initialize
  Updated some comments.
sql/handler.cc:
  Bug#39084: Getting intermittent errors with statement-based binary logging
  
  Fixed type initialise -> initialize.
sql/handler.h:
  Bug#39084: Getting intermittent errors with statement-based binary logging
  
  Added comment to understand where the cached value is set.
2008-10-29 21:20:04 +01:00
Mattias Jonsson
620d955e3a Bug#40176: update as first partitioning statement
breaks auto increment

The auto_increment value was not initialized if
the first statement after opening a table was
an 'UPDATE'.

solution was to check initialize if it was not,
before trying to increase it in update.

mysql-test/suite/parts/inc/partition_auto_increment.inc:
  Bug#40176: update as first partitioning statement
  breaks auto increment
  
  Added tests for verifying the bug and show some more
  auto_increment flaws
mysql-test/suite/parts/r/partition_auto_increment_archive.result:
  Bug#40176: update as first partitioning statement
  breaks auto increment
  
  Updated test results, due to added tests
mysql-test/suite/parts/r/partition_auto_increment_blackhole.result:
  Bug#40176: update as first partitioning statement
  breaks auto increment
  
  Updated test results, due to added tests
mysql-test/suite/parts/r/partition_auto_increment_innodb.result:
  Bug#40176: update as first partitioning statement
  breaks auto increment
  
  Updated test results, due to added tests
mysql-test/suite/parts/r/partition_auto_increment_memory.result:
  Bug#40176: update as first partitioning statement
  breaks auto increment
  
  Updated test results, due to added tests
mysql-test/suite/parts/r/partition_auto_increment_myisam.result:
  Bug#40176: update as first partitioning statement
  breaks auto increment
  
  Updated test results, due to added tests
mysql-test/suite/parts/r/partition_auto_increment_ndb.result:
  Bug#40176: update as first partitioning statement
  breaks auto increment
  
  Updated test results, due to added tests
sql/ha_partition.cc:
  Bug#40176: update as first partitioning statement
  breaks auto increment
  
  make sure that the auto_increment value is initialized
  before updating it.
  
  (missed initializing in mysql_update_row).
sql/ha_partition.h:
  Bug#40176: update as first partitioning statement
  breaks auto increment
  
  Assert that it is initialized, before updating
  the auto_increment value
2008-10-23 22:14:07 +02:00
Michael Widenius
058916ae02 Fix for bug#39226 Maria: crash with FLUSH TABLES WITH READ LOCK after LOCK TABLES
- The problem was that we didn't inform the handler that we are going to close tables that are locked and may have (at least in Maria) be part of an active transaction.
Fix for Bug#39227 Maria: crash with ALTER TABLE PARTITION
Fix for Bug #39987 main.partition_not_windows fails under debug build
Fixed some compiler errors & warnings found by pushbuild

include/my_base.h:
  Added HA_EXTRA_PREPARE_FOR_FORCED_CLOSE for signaling the handler that the file will be forced closed
include/my_global.h:
  Removed 'register' from 'swap_variables' as this gives a warnings when the variables are structs. Compilers should also now be smart enough to figure out this themselves
mysql-test/r/subselect_debug.result:
  Reset value of the debug variable;  Without setting this the subselect_innodb test will fail when run after this one
mysql-test/suite/maria/r/maria.result:
  Merged test with myisam.test
  Added tests for new fixed bugs
mysql-test/suite/maria/t/maria.test:
  Merged test with myisam.test
  Added tests for new fixed bugs
mysql-test/t/subselect_debug.test:
  Reset value of the debug variable;  Without setting this the subselect_innodb test will fail when run after this one
mysys/my_uuid.c:
  Fixed compiler error on windows
sql/ha_partition.cc:
  Added support for the new extra flag: HA_EXTRA_PREPARE_FOR_FORCED_CLOSE (Bug #39226)
  Ensure that we call extra() for HA_EXTRA_PREPARE_FOR_DROP (Bug#39227)
sql/mysqld.cc:
  Fix for Bug #39987 main.partition_not_windows fails under debug build
  The problem was that when compiling for purify/valgrind realpath() is not used, which causes test_if_data_home_dir to fail when it shouldn't
sql/sql_base.cc:
  Call HA_EXTRA_PREPARE_FOR_FORCED_CLOSE for tables that are locked but we are going to force close without doing a commit
sql/sql_parse.cc:
  More DBUG_PRINT. Fixed comments
storage/maria/ma_extra.c:
  If HA_EXTRA_PREPARE_FOR_FORCED_CLOSE is called and the table is part of a transaction, remove the table from beeing part of a transaction.
  This is safe as this is only used as part of flush tables or when the table is not part of a transaction
storage/myisam/mi_open.c:
  Indentation fix
unittest/mysys/waiting_threads-t.c:
  Remove not needed 'volatile' to get rid of compiler warnings on windows
2008-10-12 13:09:52 +03:00
Michael Widenius
5d2a1425d7 (Mostly) automatic merge
Fixed also some failing tests after merge. The files that was touched outside of the merge has a more explicit comment


include/my_global.h:
  Remove 'register' from 'swap_variables' as this gives a warnings when the variables are structs. Compilers should also now be smart enough to figure out this themselves
mysql-test/t/subselect_debug.test:
  Reset value of the debug variable;  Without setting this the subselect_innodb test will fail when run after this one
sql/mysqld.cc:
  Fix for Bug #39987 main.partition_not_windows fails under debug build
  The problem was that when compiling for purify/valgrind realpath() is not used, which causes test_if_data_home_dir to fail when it shouldn't
unittest/mysys/waiting_threads-t.c:
  Remove not needed 'volatile' to get rid of compiler warnings on windows
2008-10-12 11:57:24 +03:00
Mattias Jonsson
c6115db4c3 Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
on non-partitioned table

Problem was that partitioning specific commands was accepted
for non partitioned tables and treated like
ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE, after bug-20129 was fixed,
which changed the code path from mysql_alter_table to
mysql_admin_table.

Solution was to check if the table was partitioned before
trying to execute the admin command

mysql-test/r/partition_mgm_err.result:
  Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
  on non-partitioned table
  
  Updated test result
mysql-test/t/partition_mgm_err.test:
  Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
  on non-partitioned table
  
  Updated test case
sql/ha_partition.cc:
  Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
  on non-partitioned table
  
  Simplified the code by using ALTER_ADMIN_PARTITION for all
  commands that go through mysql_admin_tables and is set
  for partitioning specific commands that.
sql/ha_partition.h:
  Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
  on non-partitioned table
  
  Simplified the code by using ALTER_ADMIN_PARTITION for all
  commands that go through mysql_admin_tables and is set
  for partitioning specific commands that.
sql/sql_lex.h:
  Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
  on non-partitioned table
  
  Simplified the code by using ALTER_ADMIN_PARTITION for all
  commands that go through mysql_admin_tables and is set
  for partitioning specific commands that.
  
  Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
  added ALTER_ADMIN_PARTITION instead.
sql/sql_partition.cc:
  Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
  on non-partitioned table
  
  Simplified the code by using ALTER_ADMIN_PARTITION for all
  commands that go through mysql_admin_tables and is set
  for partitioning specific commands that.
  
  Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
  added ALTER_ADMIN_PARTITION instead.
sql/sql_table.cc:
  Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
  on non-partitioned table
  
  Give error and return if trying partitioning admin command
  on non partitioned table.
  
  Simplified the code by using ALTER_ADMIN_PARTITION for all
  commands that go through mysql_admin_tables and is set
  for partitioning specific commands that.
  
  Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
  added ALTER_ADMIN_PARTITION instead.
sql/sql_yacc.yy:
  Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
  on non-partitioned table
  
  Simplified the code by using ALTER_ADMIN_PARTITION for all
  commands that go through mysql_admin_tables and is set
  for partitioning specific commands that.
  
  Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
  added ALTER_ADMIN_PARTITION instead.
2008-10-10 20:12:38 +02:00
Michael Widenius
f47e003e1b Merged 5.1 with maria 5.1 2008-10-10 18:28:41 +03:00
Michael Widenius
3bbba83407 Fix for bug#39226 Maria: crash with FLUSH TABLES WITH READ LOCK after LOCK TABLES
The problem was that we didn't inform the handler that we are going to close tables that are locked and may have (at least in Maria) be part of an active transaction.

Fix for Bug#39227 Maria: crash with ALTER TABLE PARTITION



include/my_base.h:
  Added HA_EXTRA_PREPARE_FOR_FORCED_CLOSE for signaling the handler that the file will be forced closed
mysql-test/r/maria.result:
  Test cases for bugs fixed
mysql-test/t/maria.test:
  Test cases for bugs fixed
sql/ha_partition.cc:
  Added support for the new extra flag: HA_EXTRA_PREPARE_FOR_FORCED_CLOSE (Bug #39226)
  Ensure that we call extra() for HA_EXTRA_PREPARE_FOR_DROP (Bug#39227)
sql/sql_base.cc:
  Call HA_EXTRA_PREPARE_FOR_FORCED_CLOSE for tables that are locked but we are going to force close without doing a commit
storage/maria/ma_extra.c:
  If HA_EXTRA_PREPARE_FOR_FORCED_CLOSE is called and the table is part of a transaction, remove the table from beeing part of a transaction. This is safe as this is only used as part of flush tables or when the table is not part of a transaction
2008-10-10 17:14:39 +03:00
Mattias Jonsson
d3ea743015 Bug#37721: ORDER BY when WHERE contains non-partitioned
index column

There was actually two problems
1) when clustered pk, order by non pk index should also
compare with pk as last resort to differ keys from each
other
2) bug in the index search handling in ha_partition (was
found when extending the test case

Solution to 1 was to include the pk in key compare if
clustered pk and search on other index.

Solution for 2 was to remove the optimization from
ordered scan to unordered scan if clustered pk.

mysql-test/r/partition_innodb.result:
  Bug#37721: ORDER BY when WHERE contains non-partitioned
  index column
  
  updated test result.
mysql-test/t/partition_innodb.test:
  Bug#37721: ORDER BY when WHERE contains non-partitioned
  index column
  
  Added test case for bug verification.
sql/ha_partition.cc:
  Bug#37721: ORDER BY when WHERE contains non-partitioned
  index column
  
  using m_curr_key_info with both given index and PK
  if clustered PK.
  Also including PK in read_set.
  Added debug prints for easier verification.
sql/ha_partition.h:
  Bug#37721: ORDER BY when WHERE contains non-partitioned
  index column
  
  Changed m_curr_key_info to a null terminated array
  with max 2 keys and a terminating null.
  For use with key_rec_cmp with both given index and PK.
sql/key.cc:
  Bug#37721: ORDER BY when WHERE contains non-partitioned
  index column
  
  added handling of a null terminated array of keys for
  use in compare.
2008-10-10 12:01:01 +02:00
Alexey Botchkov
afbb52c43c Bug#38005 Partitions: error with insert select.
MyISAM blocks index usage for bulk insert into zero-records tables.
See ha_myisam::start_bulk_insert() lines from
...
    if (file->state->records == 0 ...
...

That causes problems for partition engine when some partitions have records some not
as the engine uses same access method for all partitions.

Now partition engine doesn't call index_first/index_last
for empty tables.

per-file comments:
  mysql-test/r/partition.result
        Bug#38005 Partitions: error with insert select.
        test result

  mysql-test/t/partition.test
        Bug#38005 Partitions: error with insert select.
        test case

  sql/ha_partition.cc
        Bug#38005 Partitions: error with insert select.
        ha_engine::index_first and
        ha_engine::index_last not called for empty tables.
2008-10-06 18:14:20 +05:00
Mattias Jonsson
65811a336d Bug#37453: Dropping/creating index on partitioned table with
InnoDB Plugin locks table

The fast/on-line add/drop index handler calls was not implemented
whithin the partitioning.

This implements it in the partitioning handler.

Since this is only used by the not included InnoDB plugin, there
is no test case. (Have tested it manually with the plugin, and
it does not allow unique indexes not including partitioning
function, or removal of pk, which in innodb generates a new pk,
which is not in the partitioning function.)

NOTE: This introduces a new handler method, and because of that
changes the storage engine api. (One cannot use a handlerton to
see the capabilities of a table's handler if it is partitioned.
So I added a wrapper function in the handler that defaults to
the handlerton function, which the partitioning handler overrides.

sql/ha_partition.cc:
  Bug#37453: Dropping/creating index on partitioned table with
  InnoDB Plugin locks table
  
  Added support for fast/on-line add/drop index.
  Implemented alter_table_flags as bit-or of the partitioned
  hton and the first partitions alter_table_flags.
  
  It is only to forward the calls for the other functions:
  check_if_incompatible_data
  add_index
  prepare_drop_index
  final_drop_index
  
  to all parts handler
sql/ha_partition.h:
  Bug#37453: Dropping/creating index on partitioned table with
  InnoDB Plugin locks table
  
  Added support for fast/on-line add/drop index.
sql/handler.h:
  Bug#37453: Dropping/creating index on partitioned table with
  InnoDB Plugin locks table
  
  Added the function on handler level, defaulting to use
  the handlerton function, but a handler can override it.
  Needed for partitioned tables.
  
  NOTE: Change of storage engine api.
sql/sql_partition.cc:
  Bug#37453: Dropping/creating index on partitioned table with
  InnoDB Plugin locks table
  
  Using the new handler function, instead of the handlerton
  function. This works better with the partitioning handler.
sql/sql_table.cc:
  Bug#37453: Dropping/creating index on partitioned table with
  InnoDB Plugin locks table
  
  Using the new handler function, instead of the handlerton
  function. This works better with the partitioning handler.
  Also using new process info for 'manage keys' (kind of fix
  for bug-37550).
2008-10-05 00:40:30 +02:00
Mattias Jonsson
51cb9ac0e1 post push fix for bug#38804 (back port of bug#33479)
Removes the regression bug#38751.

sql/ha_partition.cc:
  post push fix for bug#38804 (back port of bug#33479)
  Removes the regression bug#38751.
  
  archive relies on a ha_archive::info call to flush data before
  the copy takes place in alter table.
  
  This ensures that all partitions gets a info call, without having
  to always forward info(HA_STATUS_AUTO) to all partitions.
2008-10-03 11:30:54 +02:00
Mattias Jonsson
3a2727f74f pre push fix for bug#38804
sql/ha_partition.cc:
  pre push fix for bug#38804
  Found a missing 'if' for releasing the mutex
2008-10-01 12:40:05 +02:00
Mattias Jonsson
22e0319620 merge 2008-10-01 12:14:55 +02:00
Mattias Jonsson
3e1d88d188 Bug#30573: Ordered range scan over partitioned tables returns some rows twice
and
Bug#33555: Group By Query does not correctly aggregate partitions

Backport of bug-33257 which is the same bug.

read_range_*() calls was not passed to the partition handlers,
but was translated to index_read/next family calls.
Resulting in duplicates rows and wrong aggregations.

mysql-test/r/partition_range.result:
  Bug#30573: Ordered range scan over partitioned tables returns some rows twice
  
  Updated result file
mysql-test/t/partition_range.test:
  Bug#30573: Ordered range scan over partitioned tables returns some rows twice
  
  Re-enabled the test
sql/ha_partition.cc:
  Bug#30573: Ordered range scan over partitioned tables returns some rows twice
  
  backport of bug-33257, correct handling of read_range_* calls,
  without converting them to index_read/next calls
sql/ha_partition.h:
  Bug#30573: Ordered range scan over partitioned tables returns some rows twice
  
  backport of bug-33257, correct handling of read_range_* calls,
  without converting them to index_read/next calls
2008-09-18 22:49:34 +03:00
Mattias Jonsson
be63f0af4f Bug#38804: Query deadlock causes all tables to be inaccessible.
Problem was a mutex added in bug n 27405 for solving a problem
with auto_increment in partitioned innodb tables.
(in ha_partition::write_row over partitions file->ha_write_row)

Solution is to use the patch for bug#33479, which refines the
usage of mutexes for auto_increment.

Backport of bug-33479 from 6.0:

Bug-33479: auto_increment failures in partitioning

Several problems with auto_increment in partitioning
(with MyISAM, InnoDB. Locking issues, not handling
multi-row INSERTs properly etc.)

Changed the auto_increment handling for partitioning:
Added a ha_data variable in table_share for storage engine specific data
such as auto_increment value handling in partitioning, also see WL 4305
and using the ha_data->mutex to lock around read + update.

The idea is this:
Store the table's reserved auto_increment value in
the TABLE_SHARE and use a mutex to, lock it for reading and updating it
and unlocking it, in one block. Only accessing all partitions
when it is not initialized.
Also allow reservations of ranges, and if no one has done a reservation
afterwards, lower the reservation to what was actually used after
the statement is done (via release_auto_increment from WL 3146).
The lock is kept from the first reservation if it is statement based
replication and a multi-row INSERT statement where the number of
candidate rows to insert is not known in advance (like INSERT SELECT,
LOAD DATA, unlike INSERT VALUES (row1), (row2),,(rowN)).

This should also lead to better concurrancy (no need to have a mutex
protection around write_row in all cases)
and work with any local storage engine.

mysql-test/suite/parts/inc/partition_auto_increment.inc:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  Test source file for testing auto_increment
mysql-test/suite/parts/r/partition_auto_increment_archive.result:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  result file for testing auto_increment
mysql-test/suite/parts/r/partition_auto_increment_blackhole.result:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  result file for testing auto_increment
mysql-test/suite/parts/r/partition_auto_increment_innodb.result:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  result file for testing auto_increment
mysql-test/suite/parts/r/partition_auto_increment_memory.result:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  result file for testing auto_increment
mysql-test/suite/parts/r/partition_auto_increment_myisam.result:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  result file for testing auto_increment
mysql-test/suite/parts/r/partition_auto_increment_ndb.result:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  result file for testing auto_increment
mysql-test/suite/parts/t/partition_auto_increment_archive.test:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  test file for testing auto_increment
mysql-test/suite/parts/t/partition_auto_increment_blackhole.test:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  test file for testing auto_increment
mysql-test/suite/parts/t/partition_auto_increment_innodb.test:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  test file for testing auto_increment
mysql-test/suite/parts/t/partition_auto_increment_memory.test:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  test file for testing auto_increment
mysql-test/suite/parts/t/partition_auto_increment_myisam.test:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  test file for testing auto_increment
mysql-test/suite/parts/t/partition_auto_increment_ndb.test:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  test file for testing auto_increment
sql/ha_partition.cc:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: Failures using auto_increment and partitioning
  
  Changed ha_partition::get_auto_increment from file->get_auto_increment
  to file->info(HA_AUTO_STATUS), since it is works better with InnoDB
  (InnoDB can have issues with partitioning and auto_increment,
  where get_auto_increment sometimes can return a non updated value.)
  
  Using the new table_share->ha_data for keeping the auto_increment
  value, shared by all instances of the same table.
  It is read+updated when holding a auto_increment specific mutex.
  Also added release_auto_increment to decrease gaps if possible.
  And a lock for multi-row INSERT statements where the number of candidate
  rows to insert is not known in advance (like INSERT SELECT, LOAD DATA;
  Unlike INSERT INTO (row1),(row2),,(rowN)).
  Fixed a small bug, copied++ to (*copied)++ and the same for deleted.
  Changed from current_thd, to ha_thd()
sql/ha_partition.h:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: Failures using auto_increment and partitioning
  
  Added a new struct HA_DATA_PARTITION to be used in table_share->ha_data
  Added a private function to set auto_increment values if needed
  Removed the restore_auto_increment (the hander version is better)
  Added lock/unlock functions for auto_increment handling.
  Changed copied/deleted to const.
sql/handler.h:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  Added const for changed_partitions
  Added comments about SQLCOM_TRUNCATE for delete_all_rows
sql/table.h:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: Failures using auto_increment and partitioning
  
  Added a variable in table_share: ha_data for storage of storage engine
  specific data (such as auto_increment handling in partitioning).
2008-09-08 15:30:01 +02:00
Mattias Jonsson
5d5d1a814d Backport of patch for Bug#34604 (from 6.0)
post push fix for bug#20129, test failed due to non existing
source files.

mysql-test/Makefile.am:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Test parts.partition_repair_myisam failed because the corrupted
  pre fabricated files was not included in the dist-file.
mysql-test/suite/parts/r/partition_special_innodb.result:
  Bug#34604: hander::ha_rnd_end(): Assertion inited==RND failed
  
  updated result file
mysql-test/suite/parts/t/partition_special_innodb-master.opt:
  Bug#34604: hander::ha_rnd_end(): Assertion inited==RND failed
  
  Added parameter to speed up the test.
  Set to 2 seconds to be working on slow machines.
mysql-test/suite/parts/t/partition_special_innodb.test:
  Bug#34604: hander::ha_rnd_end(): Assertion inited==RND failed
  
  Added test for verifying the bug (without the patch in
  ha_partition.cc, this crashes a debug compiled server)
sql/ha_partition.cc:
  Bug#34604: hander::ha_rnd_end(): Assertion inited==RND failed
  
  In some cases error was not properly propagated through
  ha_partition::rnd_next.
  
  Will now return the error code from the partitions rnd_next and
  update m_part_spec.start_part and m_last_part properly.
  This makes the inited state to be correct.
2008-08-20 17:29:14 +02:00
Mattias Jonsson
55bf4addb6 merge 2008-08-19 12:26:30 +02:00
Mattias Jonsson
ad15cd6882 Post push fix for valgrind warning in ha_partition.cc
Bug#35161
Fixed memory leak when failing to open a partition.

Bug#20129
Added tests for verifying REPAIR PARTITION.

mysql-test/std_data/parts/t1_will_crash#P#p1_first_1024.MYD:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  (see mysql-test/suite/parts/t/partition_repair_myisam.test
  Created by:
  CREATE TABLE t1_will_crash (
    a VARCHAR(255),
    b INT,
    c LONGTEXT,
    PRIMARY KEY (a, b))ENGINE=MyISAM
  PARTITION BY HASH (b)
  PARTITIONS 7;
  INSERT INTO t1_will_crash VALUES ...
  and then
  head -c 1024 var/master-data/test/t1_will_crash#P#p1.MYD
  into this file.
mysql-test/std_data/parts/t1_will_crash#P#p2.MYD:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  (see mysql-test/suite/parts/t/partition_repair_myisam.test)
  copy of file right after _mi_mark_file_changed in mi_write
  was done.
mysql-test/std_data/parts/t1_will_crash#P#p2.MYI:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  (see mysql-test/suite/parts/t/partition_repair_myisam.test)
  copy of file right after _mi_mark_file_changed in mi_write
  was done.
mysql-test/std_data/parts/t1_will_crash#P#p3.MYI:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  (see mysql-test/suite/parts/t/partition_repair_myisam.test)
  copy of file right after *share->write_record was done.
mysql-test/std_data/parts/t1_will_crash#P#p4.MYI:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  (see mysql-test/suite/parts/t/partition_repair_myisam.test)
  copy of file right after flush_cached_blocks
mysql-test/std_data/parts/t1_will_crash#P#p6.MYD:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  (see mysql-test/suite/parts/t/partition_repair_myisam.test)
  copy of file right after _mi_write_part_record in
  write_dynamic_record returned for the first time.
mysql-test/std_data/parts/t1_will_crash#P#p6_2.MYD:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  (see mysql-test/suite/parts/t/partition_repair_myisam.test)
  copy of file right after _mi_write_part_record in
  write_dynamic_record returned for the second time.
mysql-test/std_data/parts/t1_will_crash#P#p6_3.MYD:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  (see mysql-test/suite/parts/t/partition_repair_myisam.test)
  copy of file right after _mi_write_part_record in
  write_dynamic_record returned for the third time.
  (data file fully updated).
mysql-test/suite/parts/r/partition_recover_myisam.result:
  Bug#35161
  
  Renamed since it was a test of recover
  and to make repair free for use without
  --myisam-recover
mysql-test/suite/parts/r/partition_repair_myisam.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  New result file for testing CHECK/REPAIR of partitioned tables
mysql-test/suite/parts/t/partition_recover_myisam-master.opt:
  Bug#35161
  
  Renamed since it was a test of recover
  and to make repair free for use without
  --myisam-recover
mysql-test/suite/parts/t/partition_recover_myisam.test:
  Bug#35161
  
  Renamed since it was a test of recover
  and to make repair free for use without
  --myisam-recover
mysql-test/suite/parts/t/partition_repair_myisam.test:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
  
  New test file for testing CHECK/REPAIR of partitioned tables
sql/ha_partition.cc:
  Bug#35161
  
  Fix of memory leak when open of partition failed.
2008-08-19 11:44:22 +02:00
Chad MILLER
35c8b4c5e7 Bug#38272: timestamps fields incorrectly defaulted on \
update accross partitions.
      
It's not Innodb-specific bug.
ha_partition::update_row() didn't set
table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET when
orig_timestamp_type == TIMESTAMP_AUTO_SET_ON_INSERT.

So that a partition sets the timestamp field when a record
is moved to a different partition.

Fixed by doing '= TIMESTAMP_NO_AUTO_SET' unconditionally.
Also ha_partition::write_row() is fixed in same way as now
Field_timestamp::set() is called twice in SET_ON_INSERT case.

(Chad queues this patch on demand by Trudy/Davi.)

mysql-test/r/partition.result:
  Bug#38272 timestamps fields incorrectly defaulted on update accross partitions.
  test result
mysql-test/t/partition.test:
  Bug#38272 timestamps fields incorrectly defaulted on update accross partitions.
  test case
sql/ha_partition.cc:
  Bug#38272 timestamps fields incorrectly defaulted on update accross partitions.
  Do table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET unconditionally
  in ha_partition::update_row and ::write_row()
2008-08-15 14:26:25 -04:00
Mattias Jonsson
c8d01f1401 Bug#37402: Mysql cant read partitioned table with capital letter in the name
Post push fix (compiler warning)

sql/ha_partition.cc:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  fix to prevent a compiler warning.
2008-08-13 10:47:24 +02:00
Mattias Jonsson
642bf9022a manual merge of bug#37402 2008-08-12 12:26:23 +02:00
Mattias Jonsson
1c06de1fd6 manual merge of Bug#20129 into 5.1-bugteam 2008-08-11 20:06:08 +02:00
Mattias Jonsson
f50c4207f2 Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
partition is corrupt

The main problem was that ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR
PARTITION took another code path (over mysql_alter_table instead of
mysql_admin_table) which differs in two ways:
1) alter table opens the tables in a different way than admin tables do
   resulting in returning with error before it tried the command
2) alter table does not start to send any diagnostic rows to the client
   which the lower admin functions continue to use -> resulting in
   assertion crash

The fix:
Remapped ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION to use
the same code path as ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE t.
Adding check in mysql_admin_table to setup the partition list for
which partitions that should be used.


Partitioned tables will still not work with
REPAIR TABLE/PARTITION USE_FRM, since that requires moving partitions
to tables, REPAIR TABLE t USE_FRM, and check that the data still
fulfills the partitioning function and then move the table back to
being a partition.

NOTE: I have removed the following functions from the handler
interface:
analyze_partitions, check_partitions, optimize_partitions,
repair_partitions
Since they are not longer needed.
THIS ALTERS THE STORAGE ENGINE API

mysql-test/r/handler_innodb.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a note result row.
mysql-test/r/innodb.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a note result row.
mysql-test/r/innodb_mysql.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a note result row.
mysql-test/r/partition.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
mysql-test/r/trigger-trans.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a note result row.
mysql-test/suite/ndb/r/ndb_partition_key.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
mysql-test/suite/ndb/t/ndb_partition_key.test:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
mysql-test/suite/parts/inc/partition_alter4.inc:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
mysql-test/suite/parts/r/partition_alter4_innodb.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
mysql-test/suite/parts/r/partition_alter4_myisam.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
mysql-test/suite/rpl/r/rpl_failed_optimize.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a note result row.
mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a note result row.
mysql-test/t/partition.test:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
  tables.
sql/ha_partition.cc:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added a function for returning admin commands result rows
  Updated handle_opt_partitions to handle admin commands result rows,
  and some error filtering (as mysql_admin_table do).
  
  Removed the functions analyze/check/optimize/repair_partitions
  since they have no longer any use.
sql/ha_partition.h:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Removed analyze/check/optimize/repair_partitions since they
  are no longer are needed.
sql/handler.cc:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Removed analyze/check/optimize/repair_partitions since they
  are no longer are needed.
sql/handler.h:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Removed analyze/check/optimize/repair_partitions since they
  are no longer are needed.
sql/mysql_priv.h:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added set_part_state for reuse of code in mysql_admin_table.
  (Originally fond in sql/sql_partition.cc:prep_alter_part_table)
sql/protocol.cc:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added one assert and a debug print.
sql/sql_partition.cc:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Refactored code for setting up partition state, set_part_state,
  now used in both prep_alter_part_table and
  sql_table.cc:mysql_admin_table.
  Removed code for handling ANALYZE/CHECK/OPTIMIZE/REPAIR partitions,
  since it is now handled by mysql_admin_table.
sql/sql_table.cc:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Added functionality in mysql_admin_table to work with partitioned
  tables.
  Fixed a possible assertion bug for HA_ADMIN_TRY_ALTER
  (If analyze would output a row, it fails since the row was already
  started).
sql/sql_yacc.yy:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Remapped ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  to use the same code path as ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE
  instead of taking the ALTER TABLE path.
  Added reset of alter_info for ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE
  since it is now used by partitioned tables.
storage/myisam/mi_check.c:
  Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
  partition is corrupt
  
  Changed warning message from "Found X parts  Should be: Y parts"
  to "Found X key parts. Should be Y", since it could be confusing
  with partitioned tables.
2008-08-11 20:02:03 +02:00
Mattias Jonsson
2ace7dc939 merge into an updated 5.1-bugteam tree 2008-08-11 16:15:39 +02:00
Mattias Jonsson
c1e54765da Bug#37402: Mysql cant read partitioned table with capital letter in the name
Problem was that ha_partition had HA_FILE_BASED flag set
(since it uses a .par file), but after open it uses the first partitions
flags, which results in different case handling for create and for
open.

Solution was to change the underlying partition name so it was consistent.
(Only happens when lower_case_table_names = 2, i.e. Mac OS X and storage
engines without HA_FILE_BASED, like InnoDB and Memory.)

(Recommit after adding rename of check_lowercase_names to
get_canonical_filename, and moved it from handler.h to mysql_priv.h)

NOTE: if a mixed case name for a partitioned table was created when
lower_case_table_name = 2 it should be renamed or dropped before using
the updated version (See bug#37402 for more info)

mysql-test/include/have_case_insensitive_file_system.inc:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  Added include file.
mysql-test/include/have_lowercase0.inc:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  moved case insensitive file system to a new file, leaving only
  lower_case_table_names.
mysql-test/include/have_lowercase2.inc:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  Added include file.
mysql-test/lib/mtr_report.pl:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  Removed a duplicate row and suppressed warning about setting
  lower_case_table_names to 2 on case sensitive file systems.
mysql-test/r/case_insensitive_file_system.require:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  Added requirement file.
mysql-test/r/lowercase0.require:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  moved case insensitive file system to a new file, leaving only
  lower_case_table_names.
mysql-test/suite/parts/inc/partition_mgm.inc:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New include file for testing partitioning management functions for different
  settings of lower_case_table_names.
mysql-test/suite/parts/r/partition_mgm_lc0_archive.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc0_memory.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc1_archive.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc1_memory.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc2_archive.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc2_memory.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New result file.
mysql-test/suite/parts/t/partition_mgm_lc0_archive.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc0_innodb.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc0_memory.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc0_myisam.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc0_ndb.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc1_archive-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc1_archive.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc1_innodb-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc1_innodb.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc1_memory-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc1_memory.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc1_myisam-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc1_myisam.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc1_ndb-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc1_ndb.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc2_archive-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc2_archive.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc2_innodb-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc2_innodb.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc2_memory-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc2_memory.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc2_myisam-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc2_myisam.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/suite/parts/t/partition_mgm_lc2_ndb-master.opt:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New opt file.
mysql-test/suite/parts/t/partition_mgm_lc2_ndb.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  New test file.
mysql-test/t/lowercase_table3.test:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  Moved case sensitive file system to a specific inc-file instead of
  included in lowercase0.inc
sql/ha_partition.cc:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  Problem was that ha_partition had HA_FILE_BASED set
  (since it uses a .par file), but after open it uses the first partitions
  table_flags(), which results in different case handling for create and for
  open.
  
  Solution was to change the underlying partition name so it was consistent.
  (Only happens when lower_case_table_names = 2, i.e. Mac OS X)
sql/handler.cc:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  Renamed check_lowercase_names to get_canonical_filename, and exported it
  so that ha_partition.cc can use the function.
sql/mysql_priv.h:
  Bug#37402: Mysql cant read partitioned table with capital letter in the name
  
  Renamed check_lowercase_names to get_canonical_filename, and exported it
  so that ha_partition.cc can use the function.
2008-07-11 01:14:13 +02:00
Mattias Jonsson
d11d5cfca8 Bug#35745: SELECT COUNT(*) is not correct for some partitioned tables.
problem was that ha_partition::records was not implemented, thus
using the default handler::records, which is not correct if the engine
does not support HA_STATS_RECORDS_IS_EXACT.
Solution was to implement ha_partition::records as a wrapper around
the underlying partitions records.

The rows column in explain partitions will now include the total
number of records in the partitioned table.

(recommit after removing out-commented code)
2008-07-07 22:42:19 +02:00
Mattias Jonsson
ce30b928b7 Bug#35161: --myisam-recover does not work for partitioned MyISAM tables
Problem was that auto_repair, is_crashed and check_and_repair was not
implemented in ha_partition.

Solution, implemented them as loop over all partitions for is_crashed and
check_and_repair, and using the first partition for auto_repair.

(Recommit after fixing review comments)

mysql-test/lib/mtr_report.pl:
  Bug#35161: --myisam-recover does not work for partitioned MyISAM tables
  
  Added filter for crashed tables, when testing auto repair
mysql-test/std_data/corrupt_t1#P#p1.MYI:
  Bug#35161: --myisam-recover does not work for partitioned MyISAM tables
  
  Corrupt MYI file for testing auto repair
mysql-test/std_data/corrupt_t1.MYI:
  Bug#35161: --myisam-recover does not work for partitioned MyISAM tables
  
  Corrupt MYI file for testing auto repair
mysql-test/suite/parts/r/partition_repair_myisam.result:
  Bug#35161: --myisam-recover does not work for partitioned MyISAM tables
  
  Result file for testing auto repair of crashed myisam partitions
mysql-test/suite/parts/t/partition_repair_myisam-master.opt:
  Bug#35161: --myisam-recover does not work for partitioned MyISAM tables
  
  opt file for testing auto repair of crashed myisam partitions
mysql-test/suite/parts/t/partition_repair_myisam.test:
  Bug#35161: --myisam-recover does not work for partitioned MyISAM tables
  
  Test file for testing auto repair of crashed myisam partitions
sql/ha_partition.cc:
  Bug#35161: --myisam-recover does not work for partitioned MyISAM tables
  
  Added auto_repair as returning the first partitions auto_repair
  Added is_crashed and check_and_repair as loop over all partitions
sql/ha_partition.h:
  Bug#35161: --myisam-recover does not work for partitioned MyISAM tables
  
  Activating check_and_repair, auto_repair and is_crashed
2008-07-07 17:54:42 +02:00
Michael Widenius
d29e7f7472 Fix for Bug #37007 Maria: different checksum for MyISAM table depending on CHECKSUM=0|1
This also adds a check that MyISAM tables with incompatible checksums are detected by CHECK TABLE ... [FOR UPGRADE] and thus also by mysql_upgrade.
The tables that are incomatible are MyISAM tables with ROW_FORMAT=fixed and has VARCHAR fields and have CHECKSUM enabled.
Before these tables gave different checksum if you used CHECK TABLE with or without EXTENDED

mysql-test/r/old-mode.result:
  Now we get same results with and without EXTENDED
mysql-test/r/row-checksum-old.result:
  Initial results
mysql-test/r/row-checksum.result:
  Initial results
mysql-test/t/old-mode.test:
  Added test with QUICK to show that the live checksum is not used when running with --old
mysql-test/t/row-checksum-old-master.opt:
  Start mysqld with --old mode to enable old checksum code
mysql-test/t/row-checksum-old.test:
  Run row-checksum test under mysqld --old
mysql-test/t/row-checksum.test:
  Verify that checksum are calculated the same way with and without EXTENDED
  We run this with several storage engines to ensure results are the same over storage engines
sql/ha_partition.cc:
  Use new HA_HAS_xxx_CHECKSUM flags
sql/handler.cc:
  Use new HA_HAS_xxx_CHECKSUM flags
sql/handler.h:
  Split HA_HAS_CHECKSUM into HA_HAS_NEW_CHECKSUM and HA_HAS_OLD_CHECKSUM flags.
  This is a safe API change as only MyISAM and Maria should use these handler flags.
sql/sql_show.cc:
  Use new HA_HAS_xxx_CHECKSUM flags
sql/sql_table.cc:
  Use file->checksum() for live checksums if the life checksum method corresponds to the mysqld --old flag
storage/maria/ha_maria.cc:
  Use new HA_HAS_xxx_CHECKSUM flags
storage/myisam/ha_myisam.cc:
  Set HA_HAS_OLD_CHECKSUM and/or HA_HAS_NEW_CHECKSUM flags depending on if this is a new myisam or old myisam file
  Add method check_for_upgrade() to detect if the table is of old version with a checksum that is incompatible with CHECK TABLE ... EXTENDED
storage/myisam/ha_myisam.h:
  Added check_for_upgrade()
storage/myisam/mi_open.c:
  Removed not neede cast
  Initialize share->has_null_fields and share->has_varchar_fields variables
storage/myisam/myisamdef.h:
  Added share->has_null_fields and share->has_varchar_fields
2008-06-28 15:45:15 +03:00
Mattias Jonsson
06f3c43478 Bug#35931 Index search of partitioned MyISAM table
returns erroneous results

Used the wrong function when fixing 30480 which lead to
no stop on end_key resulting in duplicate results from index scan

Includes test cases for the duplicates 37327 and 37329,
Duplicate rows and bad performance/High Handler_read_next values

Recommit after merge issues

mysql-test/r/partition.result:
  Bug#35931 List partition MyISAM table returns erroneous results
  
  added test results.
mysql-test/t/partition.test:
  Bug#35931 List partition MyISAM table returns erroneous results
  
  added test for 35931, 37327 and 37329.
sql/ha_partition.cc:
  Bug#35931 List partition MyISAM table returns erroneous results
  
  HA_READ_ORDER is a index_flag, not a table_flag.
  Error made in 30480.
2008-06-17 12:41:06 +02:00
unknown
f83bd712ae Merge bk-internal.mysql.com:/home/bk/mysql-maria
into  mysql.com:/home/my/mysql-maria


mysql-test/r/maria.result:
  Auto merged
mysql-test/suite/ndb/r/ndb_auto_increment.result:
  Auto merged
mysql-test/t/maria.test:
  Auto merged
mysys/hash.c:
  Auto merged
mysys/thr_lock.c:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_ndbcluster.h:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/ha_partition.h:
  Auto merged
sql/handler.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/log_event_old.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/sql_load.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
storage/csv/ha_tina.cc:
  Auto merged
storage/federated/ha_federated.cc:
  Auto merged
storage/maria/Makefile.am:
  Auto merged
storage/maria/ma_check.c:
  Auto merged
storage/maria/ma_control_file.c:
  Auto merged
storage/maria/ma_delete_all.c:
  Auto merged
storage/maria/ma_dynrec.c:
  Auto merged
storage/maria/ma_init.c:
  Auto merged
storage/maria/ma_key_recover.c:
  Auto merged
storage/maria/ma_open.c:
  Auto merged
storage/maria/ma_page.c:
  Auto merged
storage/maria/ma_range.c:
  Auto merged
storage/maria/ma_recovery.c:
  Auto merged
storage/maria/ma_test1.c:
  Auto merged
storage/maria/maria_read_log.c:
  Auto merged
storage/maria/unittest/ma_test_all-t:
  Auto merged
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
  Auto merged
storage/maria/unittest/ma_test_recovery.pl:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/myisamdef.h:
  Auto merged
include/my_base.h:
  Manual merge where error code are kept same as in 5.1
mysys/my_handler.c:
  No changes
sql/item.cc:
  Manual merge
sql/sql_class.cc:
  Manual merge
sql/sql_insert.cc:
  Manual merge
storage/maria/ha_maria.cc:
  Manual merge
storage/maria/ma_blockrec.c:
  Manual merge
storage/maria/ma_delete.c:
  Manual merge
storage/maria/ma_write.c:
  Manual merge
2008-05-29 21:39:25 +03:00
unknown
5099033c26 WL#3138: Maria - fast "SELECT COUNT(*) FROM t;" and "CHECKSUM TABLE t"
Added argument to maria_end_bulk_insert() to know if the table will be deleted after the operation
Fixed wrong call to strmake
Don't call bulk insert in case of inserting only one row (speed optimization as starting/stopping bulk insert
Allow storing year 2155 in year field
When running with purify/valgrind avoid copying structures over themself
Added hook 'trnnam_end_trans_hook' that is called when transaction ends
Added trn->used_tables that is used to an entry for all tables used by transaction
Fixed that ndb doesn't crash on duplicate key error when start_bulk_insert/end_bulk_insert are not called


include/maria.h:
  Added argument to maria_end_bulk_insert() to know if the table will be deleted after the operation
include/my_tree.h:
  Added macro 'reset_free_element()' to be able to ignore calls to the external free function.
  Is used to optimize end-bulk-insert in case of failures, in which case we don't want write the remaining keys in the tree
mysql-test/install_test_db.sh:
  Upgrade to new mysql_install_db options
mysql-test/r/maria-mvcc.result:
  New tests
mysql-test/r/maria.result:
  New tests
mysql-test/suite/ndb/r/ndb_auto_increment.result:
  Fixed error message now when bulk insert is not always called
mysql-test/suite/ndb/t/ndb_auto_increment.test:
  Fixed error message now when bulk insert is not always called
mysql-test/t/maria-mvcc.test:
  Added testing of versioning of count(*)
mysql-test/t/maria-page-checksum.test:
  Added comment
mysql-test/t/maria.test:
  More tests
mysys/hash.c:
  Code style change
sql/field.cc:
  Allow storing year 2155 in year field
sql/ha_ndbcluster.cc:
  Added new argument to end_bulk_insert() to signal if the bulk insert should ignored
sql/ha_ndbcluster.h:
  Added new argument to end_bulk_insert() to signal if the bulk insert should ignored
sql/ha_partition.cc:
  Added new argument to end_bulk_insert() to signal if the bulk insert should ignored
sql/ha_partition.h:
  Added new argument to end_bulk_insert() to signal if the bulk insert should ignored
sql/handler.cc:
  Don't call get_dup_key() if there is no table object. This can happen if the handler generates a duplicate key error on commit
sql/handler.h:
  Added new argument to end_bulk_insert() to signal if the bulk insert should ignored (ie, the table will be deleted)
sql/item.cc:
  Style fix
  Removed compiler warning
sql/log_event.cc:
  Added new argument to ha_end_bulk_insert()
sql/log_event_old.cc:
  Added new argument to ha_end_bulk_insert()
sql/mysqld.cc:
  Removed compiler warning
sql/protocol.cc:
  Added DBUG
sql/sql_class.cc:
  Added DBUG
  Fixed wrong call to strmake
sql/sql_insert.cc:
  Don't call bulk insert in case of inserting only one row (speed optimization as starting/stopping bulk insert involves a lot of if's)
  Added new argument to ha_end_bulk_insert()
sql/sql_load.cc:
  Added new argument to ha_end_bulk_insert()
sql/sql_parse.cc:
  Style fixes
  Avoid goto in common senario
sql/sql_select.cc:
  When running with purify/valgrind avoid copying structures over themself.  This is not a real bug in itself, but it's a waste of cycles and causes valgrind warnings
sql/sql_select.h:
  Avoid copying structures over themself.  This is not a real bug in itself, but it's a waste of cycles and causes valgrind warnings
sql/sql_table.cc:
  Call HA_EXTRA_PREPARE_FOR_DROP if table created by ALTER TABLE is going to be dropped
  Added new argument to ha_end_bulk_insert()
storage/archive/ha_archive.cc:
  Added new argument to end_bulk_insert()
storage/archive/ha_archive.h:
  Added new argument to end_bulk_insert()
storage/federated/ha_federated.cc:
  Added new argument to end_bulk_insert()
storage/federated/ha_federated.h:
  Added new argument to end_bulk_insert()
storage/maria/Makefile.am:
  Added ma_state.c and ma_state.h
storage/maria/ha_maria.cc:
  Versioning of count(*) and checksum
  - share->state.state is now assumed to be correct, not handler->state
  - Call _ma_setup_live_state() in external lock to get count(*)/checksum versioning. In case of
    not versioned and not concurrent insertable table, file->s->state.state contains the correct state information
  
  Other things:
  - file->s -> share
  - Added DBUG_ASSERT() for unlikely case
  - Optimized end_bulk_insert() to not write anything if table is going to be deleted (as in failed alter table)
  - Indentation changes in external_lock becasue of removed 'goto' caused a big conflict even if very little was changed
storage/maria/ha_maria.h:
  New argument to end_bulk_insert()
storage/maria/ma_blockrec.c:
  Update for versioning of count(*) and checksum
  Keep share->state.state.data_file_length up to date (not info->state->data_file_length)
  Moved _ma_block_xxxx_status() and maria_versioning() functions to ma_state.c
storage/maria/ma_check.c:
  Update and use share->state.state instead of info->state
  info->s to share
  Update info->state at end of repair
  Call _ma_reset_state() to update share->state_history at end of repair
storage/maria/ma_checkpoint.c:
  Call _ma_remove_not_visible_states() on checkpoint to clean up not visible state history from tables
storage/maria/ma_close.c:
  Remember state history for running transaction even if table is closed
storage/maria/ma_commit.c:
  Ensure we always call trnman_commit_trn() even if other calls fails. If we don't do that, the translog and state structures will not be freed
storage/maria/ma_delete.c:
  Versioning of count(*) and checksum:
  - Always update info->state->checksum and info->state->records
storage/maria/ma_delete_all.c:
  Versioning of count(*) and checksum:
  - Ensure that share->state.state is updated, as here is where we store the primary information
storage/maria/ma_dynrec.c:
  Use lock_key_trees instead of concurrent_insert to check if trees should be locked.
  This allows us to lock trees both for concurrent_insert and for index versioning.
storage/maria/ma_extra.c:
  Versioning of count(*) and checksum:
  - Use share->state.state instead of info->state
  - share->concurrent_insert -> share->non_transactional_concurrent_insert
  - Don't update share->state.state from info->state if transactional table
  
  Optimization:
  - Don't flush io_cache or bitmap if we are using FLUSH_IGNORE_CHANGED
storage/maria/ma_info.c:
  Get most state information from current state
storage/maria/ma_init.c:
  Add hash table and free function to store states for closed tables
  Install hook for transaction commit/rollback to update history state
storage/maria/ma_key_recover.c:
  Versioning of count(*) and checksum:
  - Use share->state.state instead of info->state
storage/maria/ma_locking.c:
  Versioning of count(*) and checksum:
  - Call virtual functions (if exists) to restore/update status
  - Move _ma_xxx_status() functions to ma_state.c
  
  info->s -> share
storage/maria/ma_open.c:
  Versioning of count(*) and checksum:
  - For not transactional tables, set info->state to point to new allocated state structure.
  - Initialize new info->state_start variable that points to state at start of transaction
  - Copy old history states from hash table (maria_stored_states) first time the table is opened
  - Split flag share->concurrent_insert to non_transactional_concurrent_insert & lock_key_tree
  - For now, only enable versioning of tables without keys (to be fixed in soon!)
  - Added new virtual function to restore status in maria_lock_database)
  
  More DBUG
storage/maria/ma_page.c:
  Versioning of count(*) and checksum:
  - Use share->state.state instead of info->state
  - Modify share->state.state.key_file_length under share->intern_lock
storage/maria/ma_range.c:
  Versioning of count(*) and checksum:
  - Lock trees based on share->lock_key_trees
  
  info->s -> share
storage/maria/ma_recovery.c:
  Versioning of count(*) and checksum:
  - Use share->state.state instead of info->state
  - Update state information on close and when reenabling logging
storage/maria/ma_rkey.c:
  Versioning of count(*) and checksum:
  - Lock trees based on share->lock_key_trees
storage/maria/ma_rnext.c:
  Versioning of count(*) and checksum:
  - Lock trees based on share->lock_key_trees
storage/maria/ma_rnext_same.c:
  Versioning of count(*) and checksum:
  - Lock trees based on share->lock_key_trees
  - Only skip rows based on file length if non_transactional_concurrent_insert is set
storage/maria/ma_rprev.c:
  Versioning of count(*) and checksum:
  - Lock trees based on share->lock_key_trees
storage/maria/ma_rsame.c:
  Versioning of count(*) and checksum:
  - Lock trees based on share->lock_key_trees
storage/maria/ma_sort.c:
  Use share->state.state instead of info->state
  Fixed indentation
storage/maria/ma_static.c:
  Added maria_stored_state
storage/maria/ma_update.c:
  Versioning of count(*) and checksum:
  - Always update info->state->checksum and info->state->records
  - Remove optimization for index file update as it doesn't work for transactional tables
storage/maria/ma_write.c:
  Versioning of count(*) and checksum:
  - Always update info->state->checksum and info->state->records
storage/maria/maria_def.h:
  Move MARIA_STATUS_INFO to ma_state.h
  
  Changes to MARIA_SHARE:
  - Added state_history to store count(*)/checksum states
  - Added in_trans as counter if table is used by running transactions
  - Split concurrent_insert into lock_key_trees and on_transactional_concurrent_insert.
  - Added virtual function lock_restore_status
  
  Changes to MARIA_HA:
  - save_state -> state_save
  - Added state_start to store state at start of transaction
storage/maria/maria_pack.c:
  Versioning of count(*) and checksum:
  - Use share->state.state instead of info->state
  
  Indentation fixes
storage/maria/trnman.c:
  Added hook 'trnnam_end_trans_hook' that is called when transaction ends
  Added trn->used_tables that is used to an entry for all tables used by transaction
  More DBUG
  Changed return type of trnman_end_trn() to my_bool
  Added trnman_get_min_trid() to get minimum trid in use.
  Added trnman_exists_active_transactions() to check if there exist a running transaction started between two commit id
storage/maria/trnman.h:
  Added 'used_tables'
  Moved all pointers into same groups to get better memory alignment
storage/maria/trnman_public.h:
  Added prototypes for new functions and variables
  Chagned return type of trnman_end_trn() to my_bool
storage/myisam/ha_myisam.cc:
  Added argument to end_bulk_insert() if operation should be aborted
storage/myisam/ha_myisam.h:
  Added argument to end_bulk_insert() if operation should be aborted
storage/maria/ma_state.c:
  Functions to handle state of count(*) and checksum
storage/maria/ma_state.h:
  Structures and declarations to handle state of count(*) and checksum
2008-05-29 18:33:33 +03:00
unknown
50ceea65cf Merge mysql.com:/home/my/mysql-5.1
into  mysql.com:/home/my/mysql-new


BitKeeper/etc/ignore:
  auto-union
BUILD/SETUP.sh:
  Auto merged
CMakeLists.txt:
  Auto merged
client/get_password.c:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqltest.c:
  Auto merged
cmd-line-utils/readline/bind.c:
  Auto merged
cmd-line-utils/readline/display.c:
  Auto merged
cmd-line-utils/readline/histexpand.c:
  Auto merged
cmd-line-utils/readline/history.c:
  Auto merged
cmd-line-utils/readline/readline.c:
  Auto merged
cmd-line-utils/readline/text.c:
  Auto merged
dbug/user.r:
  Auto merged
extra/yassl/src/handshake.cpp:
  Auto merged
include/config-win.h:
  Auto merged
include/m_string.h:
  Auto merged
include/my_global.h:
  Auto merged
include/my_pthread.h:
  Auto merged
include/mysql/plugin.h:
  Auto merged
include/mysql_com.h:
  Auto merged
include/thr_alarm.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysql/Makefile.shared:
  Auto merged
libmysql/dll.c:
  Auto merged
libmysql/get_password.c:
  Auto merged
libmysql/libmysql.c:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
mysql-test/lib/mtr_cases.pl:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/alter_table.result:
  Auto merged
mysql-test/r/change_user.result:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/merge.result:
  Auto merged
mysql-test/r/mix2_myisam.result:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/r/query_cache.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/valgrind.supp:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_events.result:
  Auto merged
mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
mysql-test/t/query_cache.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
mysql-test/t/view.test:
  Auto merged
mysys/mf_iocache.c:
  Auto merged
mysys/mf_tempfile.c:
  Auto merged
mysys/my_atomic.c:
  Auto merged
mysys/my_bit.c:
  Auto merged
mysys/my_bitmap.c:
  Auto merged
mysys/my_compress.c:
  Auto merged
mysys/my_create.c:
  Auto merged
mysys/my_delete.c:
  Auto merged
mysys/my_error.c:
  Auto merged
mysys/my_init.c:
  Auto merged
mysys/my_open.c:
  Auto merged
mysys/my_realloc.c:
  Auto merged
mysys/my_rename.c:
  Auto merged
mysys/my_symlink.c:
  Auto merged
mysys/my_sync.c:
  Auto merged
mysys/my_thr_init.c:
  Auto merged
mysys/thr_alarm.c:
  Auto merged
mysys/thr_lock.c:
  Auto merged
scripts/make_binary_distribution.sh:
  Auto merged
server-tools/instance-manager/mysql_connection.cc:
  Auto merged
sql/CMakeLists.txt:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/events.cc:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/gen_lex_hash.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_partition.h:
  Auto merged
sql/handler.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/net_serv.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/partition_info.cc:
  Auto merged
sql/rpl_injector.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/slave.h:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_load.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_test.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
sql/unireg.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
storage/csv/ha_tina.cc:
  Auto merged
storage/csv/ha_tina.h:
  Auto merged
storage/myisam/CMakeLists.txt:
  Auto merged
storage/myisam/ft_boolean_search.c:
  Auto merged
storage/myisam/ft_eval.c:
  Auto merged
storage/myisam/ft_nlq_search.c:
  Auto merged
storage/myisam/ft_parser.c:
  Auto merged
storage/myisam/ft_static.c:
  Auto merged
storage/myisam/ft_stopwords.c:
  Auto merged
storage/myisam/ft_test1.c:
  Auto merged
storage/myisam/ft_update.c:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_check.c:
  Auto merged
storage/myisam/mi_create.c:
  Auto merged
storage/myisam/mi_delete.c:
  Auto merged
storage/myisam/mi_delete_all.c:
  Auto merged
storage/myisam/mi_dynrec.c:
  Auto merged
storage/myisam/mi_key.c:
  Auto merged
storage/myisam/mi_packrec.c:
  Auto merged
storage/myisam/mi_range.c:
  Auto merged
storage/myisam/mi_search.c:
  Auto merged
storage/myisam/mi_test1.c:
  Auto merged
storage/myisam/mi_test2.c:
  Auto merged
storage/myisam/mi_test3.c:
  Auto merged
storage/myisam/mi_unique.c:
  Auto merged
storage/myisam/mi_write.c:
  Auto merged
storage/myisam/myisamchk.c:
  Auto merged
storage/myisam/myisamdef.h:
  Auto merged
storage/myisam/myisampack.c:
  Auto merged
storage/myisam/sort.c:
  Auto merged
storage/myisam/sp_test.c:
  Auto merged
support-files/mysql.spec.sh:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
configure.in:
  Manual merge
dbug/dbug.c:
  Restore to original state in Maria tree
  The big diff comes from a wrong pull from 5.0 -> 5.1 after backporting dbug to 5.0 from 5.1
include/Makefile.am:
  Manual merge
include/my_atomic.h:
  Ignore changes
include/my_base.h:
  Manual merge
include/my_dbug.h:
  Use orginal my_dbug.h from maria tree
include/my_handler.h:
  Manual merge
include/my_sys.h:
  Manual merge
include/myisam.h:
  Manual merge
mysql-test/lib/mtr_report.pl:
  Manual merge
mysql-test/r/myisam.result:
  Manual merge
mysql-test/suite/binlog/r/binlog_unsafe.result:
  Manual merge
mysql-test/suite/binlog/t/binlog_unsafe.test:
  Manual merge
mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result:
  Manual merge
mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result:
  No changes
mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test:
  Manual merge
mysql-test/t/change_user.test:
  Manual merge
mysql-test/t/disabled.def:
  Manual merge
mysql-test/t/merge.test:
  No changes
mysql-test/t/myisam.test:
  Manual merge
mysys/Makefile.am:
  Manual merge
mysys/array.c:
  Manual merge
mysys/mf_keycache.c:
  Manual merge
mysys/my_getsystime.c:
  Manual merge
mysys/my_handler.c:
  Manual merge
mysys/my_pread.c:
  Manual merge
mysys/safemalloc.c:
  Manual merge
sql/ha_partition.cc:
  Manual merge
sql/handler.cc:
  Manual merge
sql/lex.h:
  Manual merge
sql/mysql_priv.h:
  Manual merge
sql/mysqld.cc:
  Manual merge
sql/set_var.h:
  Manual merge
sql/sql_class.cc:
  Manual merge
sql/sql_insert.cc:
  Manual merge
sql/sql_parse.cc:
  Manual merge
sql/sql_select.cc:
  Manual merge
sql/sql_show.cc:
  Manual merge
sql/sql_table.cc:
  Manual merge
storage/myisam/mi_checksum.c:
  No changes
storage/myisam/mi_extra.c:
  Manual merge
storage/myisam/mi_open.c:
  Manual merge
storage/myisammrg/ha_myisammrg.cc:
  Manual merge
strings/strmake.c:
  No changes
2008-04-28 19:24:05 +03:00
unknown
01a979e8b2 Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-main
into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel


client/mysqldump.c:
  Auto merged
client/mysqltest.c:
  Auto merged
include/my_global.h:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_dynrec.c:
  Auto merged
storage/myisam/mi_open.c:
  Auto merged
storage/myisammrg/ha_myisammrg.cc:
  Auto merged
include/config-win.h:
  Manual merge between main 5.1 and 5.1 marvel.
mysql-test/r/change_user.result:
  Manual merge between main 5.1 and 5.1 marvel.
mysql-test/t/change_user.test:
  Manual merge between main 5.1 and 5.1 marvel.
sql/sql_plugin.cc:
  Manual merge between main 5.1 and 5.1 marvel.
2008-03-28 12:14:27 +02:00
unknown
1bb10ccfb1 Valgrind warnings found after bug#32943 and after merge from -main
into -engines tree.

hander::table_share was not updated after changing table->s.


sql/ha_partition.cc:
  Valgrind warning after merge -main -> -engines, after bug#32943
  
  change_table_ptr can happen in a middle of
  alter table rename/drop/... partition
  
  the newly created partitions must get the updated table_share too.
sql/sql_base.cc:
  Bug#32943 was missing a call to change_table_ptr, this was found by valgrind
  after a merge from -main to -engines.
2008-03-17 15:56:53 +01:00
unknown
c37fdbcdfd Pre push fixes
Test file fixes for bugs 20129, 31931 and 34225


mysql-test/suite/parts/r/partition_basic_symlink_innodb.result:
  Manual merge, new test case to be modified for Bug#20129
mysql-test/suite/parts/r/partition_basic_symlink_myisam.result:
  Manual merge, new test case to be modified for Bug#20129
mysql-test/suite/parts/r/partition_engine_innodb.result:
  Manual merge, fix for bug#31931
mysql-test/suite/parts/r/partition_engine_myisam.result:
  Manual merge, fix for bug#31931
mysql-test/suite/parts/t/disabled.def:
  These should work now since Bug#34225 is fixed
sql/ha_partition.cc:
  Bug#20129: partition maintenance command not working with crashed tables
  
  Fix for compiler warnings.
2008-02-24 19:13:18 +01:00
unknown
8170b22b5c Fixed compiler warnings in a lot of files
Added IMPOSSIBLE_RESULT to avoid compiler warnings when using (Item_result) -1 as a dummy value
Changed PAGE_SIZE to TEST_PAGE_SIZE to avoid compiler errors on systems where PAGE_SIZE is defined


client/get_password.c:
  Fixed compiler warning
cmd-line-utils/readline/bind.c:
  Fixed compiler warning
cmd-line-utils/readline/chardefs.h:
  Fixed compiler warning by adding marco to be used when largest_char is 255
cmd-line-utils/readline/display.c:
  Fixed compiler warnings by removing not accessed variables
cmd-line-utils/readline/histexpand.c:
  Fixed compiler warnings by removing not accessed variables
cmd-line-utils/readline/history.c:
  Fixed compiler warnings by adding cast
cmd-line-utils/readline/text.c:
  Fixed compiler warnings by removing not accessed variables and adding casts
dbug/dbug.c:
  Fixed compiler warnings by changing types
include/mysql_com.h:
  Added IMPOSSIBLE_RESULT to avoid compiler warnings when using (Item_result) -1 as a dummy value
libmysql/libmysql.c:
  Fixed compiler warning
mysql-test/t/query_cache_debug.test:
  Mark test as BIG as it uses a lot of memory
mysys/mf_iocache2.c:
  Fixed compiler warnings by adding cast
sql/event_data_objects.cc:
  Fixed compiler warnings by removing not used code
sql/events.cc:
  Fixed compiler warnings by removing not used code
sql/field.cc:
  Fixed compiler warnings by adding cast and removed not accessed variables
sql/ha_partition.cc:
  Fixed compiler warnings by removing not used code
sql/item.cc:
  Fixed compiler warnings by removing not accessed variables
  Use IMPOSSIBLE_RESULT instead of (Item_result)-1
sql/item_cmpfunc.cc:
  Fixed compiler warnings by removing not accessed variables
sql/item_func.cc:
  Fixed compiler warnings by removing not used code and not accessed variables
  Added IMPOSSIBLE_RESULT
sql/item_subselect.cc:
  Fixed compiler warnings by removing not accessed variables
sql/item_xmlfunc.cc:
  Fixed forgotten setting of xpath->error
sql/log.cc:
  Fixed compiler warnings by removing not accessed variables
sql/log_event.cc:
  Added IMPOSSIBLE_RESULT into switch
  Fixed wrong usage of DBUG_ASSERT(1)
  Removed always true DBUG_ASSERT()
sql/mysqld.cc:
  Fixed compiler warnings by adding casts for ULONG_MAX
sql/opt_sum.cc:
  Fixed compiler warnings by removing not used code
  Removed wrong DBUG_ASSERT()
sql/partition_info.cc:
  Fixed compiler warnings by removing not accessed variables
sql/rpl_injector.h:
  Removed always true part from DBUG_ASSERT() to remove compiler warning
sql/spatial.cc:
  Fixed compiler warnings by removing not accessed variables
sql/sql_acl.cc:
  Fixed compiler warnings by removing not accessed variables
sql/sql_base.cc:
  Fixed compiler warnings by removing not accessed variables
sql/sql_cache.cc:
  Fixed compiler warnings by removing not accessed variables
sql/sql_class.cc:
  Fixed compiler warnings by:
  - Removing always true part from DBUG_ASSERT()
  - Removing not used code
  - Added IMPOSSIBLE_RESULT into switch
sql/sql_load.cc:
  Fixed compiler warnings by removing not accessed variables
sql/sql_parse.cc:
  Fixed compiler warnings by:
  - Removing not accessed variables
  - Removing always true part from DBUG_ASSERT()
  - Removing not used code
sql/sql_plugin.cc:
  Added comment
sql/sql_prepare.cc:
  Fixed compiler warnings by removing not accessed variables
sql/sql_show.cc:
  Fixed compiler warnings by using correct cast
sql/sql_table.cc:
  Fixed compiler warnings by removing not used code and removing not accessed variables
sql/table.cc:
  Fixed compiler warnings by removing not accessed variables
sql/time.cc:
  Fixed wrong DBUG_ASSERT(1)
storage/maria/unittest/Makefile.am:
  Changed PAGE_SIZE to TEST_PAGE_SIZE to avoid compiler errors on systems where PAGE_SIZE is defined
storage/maria/unittest/ma_pagecache_consist.c:
  Changed PAGE_SIZE to TEST_PAGE_SIZE to avoid compiler errors on systems where PAGE_SIZE is defined
storage/maria/unittest/ma_pagecache_single.c:
  Changed PAGE_SIZE to TEST_PAGE_SIZE to avoid compiler errors on systems where PAGE_SIZE is defined
tests/mysql_client_test.c:
  Fixed compiler warnings by removing not accessed variables and changing types
2008-02-13 21:27:12 +02:00
unknown
6a15453640 Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
Problem was that it did not work with corrupted/crashed tables.

Solution is to disable these commands until WL#4176 is completed


mysql-test/r/partition.result:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Test result
mysql-test/suite/parts/inc/partition_alter4.inc:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  copy-paste error, changed from REBUILT to REPAIR, as the heading says
mysql-test/suite/parts/r/partition_alter1_innodb.result:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Test result
mysql-test/suite/parts/r/partition_alter1_myisam.result:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Test result
mysql-test/suite/parts/r/partition_alter2_innodb.result:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Test result
mysql-test/suite/parts/r/partition_alter2_myisam.result:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Test result
mysql-test/suite/parts/r/partition_basic_innodb.result:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Test result
mysql-test/suite/parts/r/partition_basic_myisam.result:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Test result
mysql-test/suite/parts/r/partition_engine_innodb.result:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Test result
mysql-test/suite/parts/r/partition_engine_myisam.result:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Test result
mysql-test/suite/parts/t/disabled.def:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Disabled test since the tested feature is not longer supported
mysql-test/t/partition.test:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  OPTIMIZE PARTITION is not longer supported, waiting for WL#4176
sql/ha_partition.cc:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Problem was that it did not work with corrupted/crashed tables.
  
  Solution is to disable these commands until WL#4176 is completed
  (returning HA_ADMIN_NOT_IMPLEMENTED and
  #ifdef'ed the non-reachable code)
2008-02-11 11:32:46 +01:00
unknown
58753e5c11 Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-main
into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel


BitKeeper/etc/ignore:
  auto-union
client/mysqlcheck.c:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqltest.c:
  Auto merged
include/Makefile.am:
  Auto merged
include/m_string.h:
  Auto merged
include/my_base.h:
  Auto merged
include/my_dbug.h:
  Auto merged
include/my_global.h:
  Auto merged
include/my_sys.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysql/Makefile.shared:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Auto merged
mysys/mf_keycache.c:
  Auto merged
sql/gen_lex_hash.cc:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/lex.h:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
sql/unireg.cc:
  Auto merged
storage/myisam/ft_boolean_search.c:
  Auto merged
storage/myisam/ft_nlq_search.c:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_check.c:
  Auto merged
storage/myisam/mi_open.c:
  Auto merged
storage/myisam/myisampack.c:
  Auto merged
storage/myisammrg/ha_myisammrg.cc:
  Auto merged
client/mysqlslap.c:
  Manual merge with main 5.1 tree.
2008-02-08 12:13:33 +01:00
unknown
2e6a7416cd Merge janus.mylan:/usr/home/serg/Abk/mysql-5.1
into  janus.mylan:/usr/home/serg/Abk/mysql-maria


include/my_sys.h:
  Auto merged
mysql-test/lib/mtr_cases.pl:
  Auto merged
mysql-test/lib/mtr_misc.pl:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/ps_2myisam.result:
  Auto merged
mysql-test/r/ps_3innodb.result:
  Auto merged
mysql-test/r/ps_4heap.result:
  Auto merged
mysql-test/r/ps_5merge.result:
  Auto merged
mysql-test/r/query_cache.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/suite/binlog/r/binlog_unsafe.result:
  Auto merged
mysql-test/suite/binlog/t/binlog_unsafe.test:
  Auto merged
mysql-test/suite/ndb/r/ps_7ndb.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result:
  Auto merged
mysql-test/suite/rpl/t/rpl_insert.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/query_cache.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/field.h:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/slave.cc:
  Auto merged
sql/slave.h:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/unireg.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
storage/myisam/ft_boolean_search.c:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/sort.c:
  Auto merged
sql/log_event_old.h:
  SCCS merged
BitKeeper/triggers/post-commit:
  merged
client/mysqldump.c:
  merged
configure.in:
  merged
client/mysqltest.c:
  merged
include/Makefile.am:
  merged
include/atomic/nolock.h:
  merged
mysql-test/lib/mtr_report.pl:
  merged
sql/handler.h:
  merged
sql/mysqld.cc:
  merged
sql/sql_select.cc:
  merged
2008-02-05 16:47:11 +01:00
unknown
7fdbc4230e Merge janus.mylan:/usr/home/serg/Abk/mysql-5.1
into  janus.mylan:/usr/home/serg/Abk/mysql-maria


Makefile.am:
  Auto merged
configure.in:
  Auto merged
BitKeeper/triggers/post-commit:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqltest.c:
  Auto merged
include/my_dbug.h:
  Auto merged
include/mysql_com.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
server-tools/instance-manager/CMakeLists.txt:
  Auto merged
server-tools/instance-manager/mysql_connection.cc:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/gen_lex_hash.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/lex.h:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/net_serv.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.h:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_open.c:
  Auto merged
storage/myisammrg/ha_myisammrg.cc:
  Auto merged
sql/handler.cc:
  merged
sql/handler.h:
  merged
sql/mysql_priv.h:
  merged
sql/mysqld.cc:
  merged
sql/set_var.cc:
  merged
sql/sql_select.cc:
  merged
sql/sql_show.cc:
  merged
unittest/mysys/my_atomic-t.c:
  merged
2007-12-27 18:16:02 +01:00
unknown
0fbc29c197 A pre-requisite for the fix for Bug#12713 "Error in a stored function
called from a SELECT doesn't cause ROLLBACK of state"
Make private all class handler methods (PSEA API) that may modify
data. Introduce and deploy public ha_* wrappers for these methods in 
all sql/.
This necessary to keep track of all data modifications in sql/,
which is in turn necessary to be able to optimize two-phase
commit of those transactions that do not modify data.


sql/ha_partition.cc:
  Class ha_partition is no longer a friend of class handler.
  Use the public handler interface (handler::ha_ methods) for partition
  operations.
  Remove unnecessary casts from char[] to const char *.ppзи выафвыаafa
sql/handler.cc:
  Function ha_create_table() is no longer a friend of class handler.
  Use public handler::change_table_ptr() to access private members.
  This fixes a subtle bug (no test case in the test suite) when a
  deletion error occurs inside one partition of a partitioned engine. 
  The old code would crash in handler::print_error() in this case.
  
  Implement the newly introduced public ha_* wrappers of the private
  virtual handler methods.
sql/handler.h:
  Introduce ha_* wrappers to all class handler methods that may
  modify data. This is necessary to be able to keep track of
  data modifying operations of class handler and optimize read-only
  transactions.
sql/item_sum.cc:
  delete_all_rows -> ha_delete_all_rows
sql/sql_base.cc:
  Use the new public wrappers.
sql/sql_delete.cc:
  delete_all_rows -> ha_delete_all_rows
sql/sql_partition.cc:
  Use the new public wrappers.
sql/sql_select.cc:
  delete_all_rows -> ha_delete_all_rows
  delete_table -> ha_delete_table
  disabe_indexes -> ha_disable_idnexes
sql/sql_show.cc:
  delete_all_rows -> ha_delete_all_rows
sql/sql_table.cc:
  Use the public wrappers for class handler DDL methods.
  All methods which may change handler data are now accessed via a public
  wrapper.
sql/sql_union.cc:
  delete_all_rows -> ha_delete_all_rows
  {enable,disable}_indexes -> ha_{enable,disable}_indexes
sql/sql_update.cc:
  bulk_update_row -> ha_bulk_update_row
sql/unireg.cc:
  create_handler_files -> ha_create_handler_files
2007-12-20 21:16:55 +03:00
unknown
226700ee51 Make handler::{write,delete,update}_row private. It's critical
that the entire server uses their public ha_* counterparts instead,
since only then we can ensure proper tracing of these calls that
is necessary for Bug#12713.
A pre-requisite for Bug#12713 "Error in a stored function called from 
a SELECT doesn't cause ROLLBACK of statem"


sql/ha_partition.cc:
  Use ha_write_row, ha_update_row, ha_delete_row instead of now-private
  write_row, update_row, delete_row. 
  In future ha_* calls will contain more than just a call to the binary
  log, so it's essential they are used consistently everywhere in the server.
  
  Disable the undesired effect of double binary logging of changes
  to partitioned tables with tmp_disable_binlog.
sql/handler.h:
  Make write_row, update_row, delete_row private. It's critical
  that the entire code base uses ha_write_row, ha_update_row, ha_delete_row
  instead -- in future, ha_* counterparts will have more common
  functionality than just a call to the binary log.
sql/sql_select.cc:
  Use ha_write_row, ha_update_row, ha_delete_row instead of
  write_row, update_row, delete_row respectively. 
  The change affects the join execution code that works with an
  intermediate internal temporary table. Do not disable binary logging,
  since it's unnecessary - temporary tables are not replicated
  by row level replication.
sql/sql_table.cc:
  Use ha_write_row in copy_data_between_tables - the function
  that writes data from the original table to a temporary copy
  when executing ALTER TABLE. Do not disable binary logging
  since temporary tables are not replicated by row level 
  replication anyway.
2007-12-19 22:15:02 +03:00
unknown
dd3bba09f2 Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-main
into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-maria.new


BitKeeper/etc/ignore:
  auto-union
BUILD/compile-dist:
  Auto merged
client/mysqladmin.cc:
  Auto merged
client/mysqldump.c:
  Auto merged
config/ac-macros/plugins.m4:
  Auto merged
configure.in:
  Auto merged
dbug/dbug.c:
  Auto merged
include/keycache.h:
  Auto merged
include/m_string.h:
  Auto merged
include/my_global.h:
  Auto merged
include/my_pthread.h:
  Auto merged
include/my_sys.h:
  Auto merged
include/mysql_com.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysql/Makefile.shared:
  Auto merged
mysql-test/lib/mtr_cases.pl:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/merge.result:
  Auto merged
mysql-test/r/myisam.result:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/r/ps_2myisam.result:
  Auto merged
mysql-test/r/ps_3innodb.result:
  Auto merged
mysql-test/r/ps_4heap.result:
  Auto merged
mysql-test/r/ps_5merge.result:
  Auto merged
mysql-test/r/query_cache.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/suite/ndb/r/ps_7ndb.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result:
  Auto merged
mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test:
  Auto merged
mysql-test/t/delayed.test:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/myisam.test:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
mysql-test/t/query_cache.test:
  Auto merged
mysql-test/t/query_cache_notembedded.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
mysql-test/t/view.test:
  Auto merged
mysys/CMakeLists.txt:
  Auto merged
mysys/Makefile.am:
  Auto merged
mysys/mf_keycache.c:
  Auto merged
mysys/my_delete.c:
  Auto merged
mysys/my_init.c:
  Auto merged
mysys/my_symlink2.c:
  Auto merged
mysys/safemalloc.c:
  Auto merged
mysys/thr_lock.c:
  Auto merged
sql/field.h:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_xmlfunc.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event_old.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/net_serv.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/slave.cc:
  Auto merged
sql/slave.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
sql/udf_example.c:
  Auto merged
storage/csv/ha_tina.cc:
  Auto merged
storage/myisam/ft_boolean_search.c:
  Auto merged
storage/myisam/ft_nlq_search.c:
  Auto merged
storage/myisam/ft_parser.c:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/ha_myisam.h:
  Auto merged
storage/myisam/mi_check.c:
  Auto merged
storage/myisam/mi_dynrec.c:
  Auto merged
storage/myisam/mi_open.c:
  Auto merged
storage/myisam/mi_packrec.c:
  Auto merged
storage/myisam/mi_write.c:
  Auto merged
storage/myisam/myisamchk.c:
  Auto merged
storage/myisam/myisampack.c:
  Auto merged
storage/myisam/rt_index.c:
  Auto merged
storage/myisam/sort.c:
  Auto merged
storage/myisammrg/ha_myisammrg.cc:
  Auto merged
storage/myisammrg/ha_myisammrg.h:
  Auto merged
strings/llstr.c:
  Auto merged
support-files/compiler_warnings.supp:
  Auto merged
Makefile.am:
  Manual merge from 5.1 to maria.
client/mysqltest.c:
  Manual merge from 5.1 to maria.
include/my_base.h:
  Manual merge from 5.1 to maria.
mysql-test/t/merge.test:
  Manual merge from 5.1 to maria.
mysys/my_getopt.c:
  Manual merge from 5.1 to maria.
mysys/thr_mutex.c:
  Manual merge from 5.1 to maria.
sql/mysqld.cc:
  Manual merge from 5.1 to maria.
sql/set_var.cc:
  Manual merge from 5.1 to maria.
sql/sql_table.cc:
  Manual merge from 5.1 to maria.
sql/sql_yacc.yy:
  Manual merge from 5.1 to maria.
sql/unireg.cc:
  Manual merge from 5.1 to maria.
2007-12-16 17:03:44 +02:00
unknown
541ac20401 Merge station.:/mnt/raid/alik/MySQL/devel/5.1
into  station.:/mnt/raid/alik/MySQL/devel/5.1-rt


client/mysqltest.c:
  Auto merged
include/mysql_com.h:
  Auto merged
libmysqld/emb_qcache.cc:
  Auto merged
libmysqld/emb_qcache.h:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_partition.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/table.cc:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
sql/protocol.cc:
  SCCS merged
2007-12-14 16:30:22 +03:00
unknown
f61f5f72f5 additional after merge fix
mysql-test/r/partition_range.result:
  removed fix for bug#30573
mysql-test/suite/parts/r/rpl_partition.result:
  updated result file
mysql-test/t/partition_range.test:
  removed test case for bug#30573
sql/ha_partition.cc:
  removed fix for bug#30573
2007-12-13 21:34:05 +04:00
unknown
9a10c20ba9 Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


BitKeeper/etc/ignore:
  auto-union
client/mysql.cc:
  Auto merged
client/mysqltest.c:
  Auto merged
include/mysql_com.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
mysql-test/r/archive.result:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/delayed.result:
  Auto merged
mysql-test/r/func_misc.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/merge.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/r/type_date.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_innodb_bug28430.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/func_misc.test:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
mysql-test/t/merge.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/type_date.test:
  Auto merged
mysql-test/t/type_datetime.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
mysys/queues.c:
  Auto merged
sql/events.cc:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_partition.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_string.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_check.c:
  Auto merged
storage/myisam/mi_open.c:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/lib/mtr_report.pl:
  manual merge
mysql-test/r/myisam.result:
  manual merge
mysql-test/r/partition.result:
  manual merge
mysql-test/r/user_var.result:
  manual merge
mysql-test/t/myisam.test:
  manual merge
mysql-test/t/partition.test:
  manual merge
mysql-test/t/user_var.test:
  manual merge
sql/item.h:
  manual merge
sql/item_func.cc:
  manual merge
storage/myisammrg/ha_myisammrg.cc:
  manual merge
2007-12-13 15:56:04 +04:00
unknown
f2b8de2368 Merge station.:/mnt/raid/alik/MySQL/devel/5.1
into  station.:/mnt/raid/alik/MySQL/devel/5.1-rt


sql/ha_partition.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_partition.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
2007-12-13 12:06:37 +03:00
unknown
2a0d2fef51 Bug#12713 "Error in a stored function called from a SELECT doesn't
cause ROLLBACK of statement", part 1. Review fixes.

Do not send OK/EOF packets to the client until we reached the end of 
the current statement.
This is a consolidation, to keep the functionality that is shared by all 
SQL statements in one place in the server.
Currently this functionality includes:
- close_thread_tables()
- log_slow_statement().

After this patch and the subsequent patch for Bug#12713, it shall also include:
- ha_autocommit_or_rollback()
- net_end_statement()
- query_cache_end_of_result().

In future it may also include:
- mysql_reset_thd_for_next_command().


include/mysql_com.h:
  Rename now unused members of NET: no_send_ok, no_send_error, report_error.
  These were server-specific variables related to the client/server
  protocol. They have been made obsolete by this patch.
  
  Previously the same members of NET were used to store the error message
  both on the client and on the server. 
  The error message was stored in net.last_error (client: mysql->net.last_error,
  server: thd->net.last_error).
  The error code was stored in net.last_errno (client: mysql->net.last_errno,
  server: thd->net.last_errno).
  The server error code and message are now stored elsewhere 
  (in the Diagnostics_area), thus NET members are no longer used by the
  server.
  Rename last_error to client_last_error, last_errno to client_last_errno
  to avoid potential bugs introduced by merges.
include/mysql_h.ic:
  Update the ABI file to reflect a rename. 
  Renames do not break the binary compatibility.
libmysql/libmysql.c:
  Rename last_error to client_last_error, last_errno to client_last_errno.
  This is necessary to ensure no unnoticed bugs introduced by merged
  changesets.
  
  Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
  Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
  Rename net.last_errno to net.client_last_errno.
  
  Update the embedded implementation of the client-server protocol to
  reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
  Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
  Update to reflect the change in mysql_rm_db(). Now we drop stored
  routines and events for a given database name only if there
  is a directory for this database name. ha_drop_database() and
  query_cache_invalidate() are called likewise. 
  Previously we would attempt to drop routines/events even if database
  directory was not found (it worked, since routines and events are stored
  in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
  does not exist".
  The change was done because the previous code used to call send_ok()
  twice, which led to an assertion failure when asserts against it were
  added by this patch.
mysql-test/r/grant.result:
  Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error 
  if mysql.procs_priv is missing.
  This fixes the assert that send_ok() must not called after send_error()
  (the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
  Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
  Produce a more detailed error message.
mysql-test/t/grant.test:
  Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
  is missing.
server-tools/instance-manager/mysql_connection.cc:
  Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
  Add asserts. 
  
  Use getters to access statement status information.
  
  Add a comment why run_query() is broken. Reset the diagnostics area
  in the end of run_query() to fulfill the invariant that the diagnostics_area
  is never assigned twice per statement (see the comment in the code
  when this can happen). We still do not clear thd->is_fatal_error and
  thd->is_slave_error, which may lead to bugs, I consider the whole affair
  as something to be dealt with separately.
sql/ha_partition.cc:
  fatal_error() doesn't set an error by itself. Perhaps we should
  remove this method altogether and instead add a flag to my_error 
  to set thd->is_fatal_error property.
  
  Meanwhile, this change is a part of inspection made to the entire source
  code with the goal to ensure that fatal_error()
  is always accompanied by my_error().
sql/item_func.cc:
  There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
  Use getters to access statement error status information.
sql/log_event_old.cc:
  Use getters to access statement error status information.
sql/mysqld.cc:
  Previously, if a continue handler for an error was found, my_message_sql() 
  would not set an error in THD. Since the current statement
  must be aborted in any case, find_handler() had a hack to assign 
  thd->net.report_error to 1.
  
  Remove this hack. Set an error in my_message_sql() even if the continue
  handler is found. The error will be cleared anyway when the handler
  is executed. This is one action among many in this patch to ensure the 
  invariant that whenever thd->is_error() is TRUE, we have a message in 
  thd->main_da.message().
sql/net_serv.cc:
  Use a full-blown my_error() in net_serv.cc to report an error,
  instead of just setting net->last_errno. This ensures the invariant that
  whenever thd->is_error() returns TRUE, we have a message in 
  thd->main_da.message().
  
  Remove initialization of removed NET members.
sql/opt_range.cc:
  Use my_error() instead of just raising thd->net.report_error. 
  This ensures the invariant that whenever thd->is_error() returns TRUE, 
  there is a message in thd->main_da.message().
sql/opt_sum.cc:
  Move invocation of fatal_error() right next to the place where
  we set the error message. That makes it easier to track that whenever
  fatal_error() is called, there is a message in THD.
sql/protocol.cc:
  Rename send_ok() and send_eof() to net_send_ok() and net_send_eof() 
  respectively. These functions write directly to the network and are not 
  for use anywhere outside the client/server protocol code. 
  
  Remove the code that was responsible for cases when either there is 
  no error code, or no error message, or both.
  Instead the calling code ensures that they are always present. Asserts
  are added to enforce the invariant.
  
  Instead of a direct access to thd->server_status and thd->total_warn_count
  use function parameters, since these from now on don't always come directly
  from THD.
  
  Introduce net_end_statement(), the single-entry-point replacement API for 
  send_ok(), send_eof() and net_send_error().
  
  Implement Protocol::end_partial_result_set to use in select_send::abort()
  when there is a continue handler.
sql/protocol.h:
  Update declarations.
sql/repl_failsafe.cc:
  Use getters to access statement status information in THD.
  Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
  Set an error message in prepare_record() if there is no default
  value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
  Use getters to access statement status information in THD.
sql/slave.cc:
  In create_table_from_dump() (a common function that is used in 
  LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
  with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
  
  Update has_temporary_error() to work correctly when no error is set.
  This is the case when Incident_log_event is executed: it always returns
  an error but does not set an error message.
  
  Use getters to access error status information.
sql/sp_head.cc:
  Instead of hacks with no_send_error, work through the diagnostics area 
  interface to suppress sending of OK/ERROR packets to the client.
  
  Move query_cache_end_of_result before log_slow_statement(), similarly
  to how it's done in dispatch_command().
sql/sp_rcontext.cc:
  Remove hacks with assignment of thd->net.report_error, they are not
  necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
  Use getters to access error status information in THD.
sql/sql_base.cc:
  Access thd->main_da.sql_errno() only if there is an error. This fixes
  a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
  Remove hacks with no_send_ok/no_send_error, they are not necessary 
  anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
  Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
  if the response has been served from the query cache. This raises the 
  question whether we should store EOF packet in the query cache at all,
  or generate it anew for each statement (we should generate it anew), but
  this is to be addressed separately.
sql/sql_class.cc:
  Implement class Diagnostics_area. Please see comments in sql_class.h
  for details.
  
  Fix a subtle coding mistake in select_send::send_data: when on slave, 
  an error in Item::send() was ignored.
  The problem became visible due to asserts that the diagnostics area is
  never double assigned.
  
  Remove initialization of removed NET members.
  
  In select_send::abort() do not call select_send::send_eof(). This is
  not inheritance-safe. Even if a stored procedure continue handler is
  found, the current statement is aborted, not succeeded.
  Instead introduce a Protocol API to send the required response, 
  Protocol::end_partial_result_set().
  
  This simplifies implementation of select_send::send_eof(). No need
  to add more asserts that there is no error, there is an assert inside
  Diagnostics_area::set_ok_status() already.
  
  Leave no trace of no_send_* in the code.
sql/sql_class.h:
  Declare class Diagnostics_area. 
  
  Remove the hack with no_send_ok from
  Substatement_state.
  
  Provide inline implementations of send_ok/send_eof.
  
  Add commetns.
sql/sql_connect.cc:
  Remove hacks with no_send_error. 
  
  Since now an error in THD is always set if net->error, it's not necessary
  to check both net->error and thd->is_error() in the do_command loop.
  
  Use thd->main_da.message() instead of net->last_errno.
  
  Remove the hack with is_slave_error in sys_init_connect. Since now we do not
  reset the diagnostics area in net_send_error (it's reset at the beginning
  of the next statement), we can access it safely even after 
  execute_init_command.
sql/sql_db.cc:
  Update the code to satisfy the invariant that the diagnostics area is never
  assigned twice.
  Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if 
  mysql.proc does not exist".
sql/sql_delete.cc:
  Change multi-delete to abort in abort(), as per select_send protocol.
  Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
  Use getters to access error information.
sql/sql_insert.cc:
  Use getters to access error information.
sql-common/client.c:
  Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
  Remove hacks with no_send_error. Deploy net_end_statement().
  
  The story of COM_SHUTDOWN is interesting. Long story short, the server 
  would become on its death's door, and only no_send_ok/no_send_error assigned
  by send_ok()/net_send_error() would hide its babbling from the client.
  
  First of all, COM_QUIT does not require a response. So, the comment saying
  "Let's send a response to possible COM_QUIT" is not only groundless 
  (even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after 
  COM_SHUTDOWN), it's plainly incorrect.
  
  Secondly, besides this additional 'OK' packet to respond to a hypothetical
  COM_QUIT, there was the following code in dispatch_command():
  
  if (thd->killed)
    thd->send_kill_message();
  if (thd->is_error()
    net_send_error(thd);
  
  This worked out really funny for the thread through which COM_SHUTDOWN
  was delivered: we would get COM_SHUTDOWN, say okay, say okay again, 
  kill everybody, get the kill signal ourselves, and then attempt to say 
  "Server shutdown in progress" to the client that is very likely long gone.
  
  This all became visible when asserts were added that the Diagnostics_area
  is not assigned twice.
  
  Move query_cache_end_of_result() to the end of dispatch_command(), since
  net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
  is a no-op if there is no started query in the cache.
  
  Consistently use select_send interface to call abort() or send_eof()
  depending on the operation result.
  
  Remove thd->fatal_error() from reset_master(), it was a no-op. 
  in hacks with no_send_error woudl save us
  from complete breakage of the client/server protocol.
  
  Consistently use select_send::abort() whenever there is an error, 
  and select_send::send_eof() in case of success.
  The issue became visible due to added asserts.
sql/sql_partition.cc:
  Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
  Deploy class Diagnostics_area.
  Remove the unnecessary juggling with the protocol in 
  Select_fetch_protocol_binary::send_eof(). EOF packet format is 
  protocol-independent.
sql/sql_select.cc:
  Call fatal_error() directly in opt_sum_query.
  Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
  Use getters to access error information in THD.
sql/sql_show.cc:
  Use getters to access error information in THD.
  
  Add comments.
  
  Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
  Replace hacks with no_send_ok with the interface of the diagnostics area.
  
  Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
  Introduce multi_update::abort(), which is the proper way to abort a
  multi-update. This fixes the merge conflict between this patch and
  the patch for Bug 29136.
sql/table.cc:
  Use a getter to access error information in THD.
sql/tztime.cc:
  Use a getter to access error information in THD.
2007-12-12 18:21:01 +03:00
unknown
4cb7841391 Merge mysql.com:/home/hf/work/32247/my51-32247
into  mysql.com:/home/hf/work/mrg/my51-mrg


mysql-test/r/partition.result:
  merging
mysql-test/t/partition.test:
  merging
sql/ha_partition.cc:
  SCCS merged
2007-12-06 16:43:52 +04:00
unknown
b6c0c1754c Bug #32247 Test reports wrong value of "AUTO_INCREMENT" (on a partitioned InnoDB table).
ha_partition::update_create_info() just calls update_create_info
of a first partition, so only get the autoincrement maximum
of the first partition, so SHOW CREATE TABLE can show
small AUTO_INCREMENT parameters.
Fixed by implementing ha_partition::update_create_info() in a way
other handlers work.
HA_ARCHIVE:stats.auto_increment handling made consistent with other engines


mysql-test/r/archive.result:
  Bug #32247 Test reports wrong value of "AUTO_INCREMENT" (on a partitioned InnoDB table).
  
  test result fixed
mysql-test/r/partition.result:
  Bug #32247 Test reports wrong value of "AUTO_INCREMENT" (on a partitioned InnoDB table).
  
  test result
mysql-test/suite/rpl/r/rpl_innodb_bug28430.result:
  Bug #32247 Test reports wrong value of "AUTO_INCREMENT" (on a partitioned InnoDB table).
  
  test result fixed
mysql-test/t/partition.test:
  Bug #32247 Test reports wrong value of "AUTO_INCREMENT" (on a partitioned InnoDB table).
  
  test added as rpl_innodb_bug28430 is INNOBASE specific while
  the bug is not
sql/ha_partition.cc:
  Bug #32247 Test reports wrong value of "AUTO_INCREMENT" (on a partitioned InnoDB table).
  
  ha_partition::update_create_info() implemented
storage/archive/ha_archive.cc:
  Bug #32247 Test reports wrong value of "AUTO_INCREMENT" (on a partitioned InnoDB table).
  
  ha_archive.stats.auto_increment now contains next (not last used) value
  of auto_increment to be consistent with other engines
2007-12-06 16:39:42 +04:00
unknown
b9ecec8622 Merge witty.:/Users/mattiasj/clones/mysql-5.1-bug30822
into  witty.:/Users/mattiasj/clones/51to_push


sql/ha_partition.cc:
  Auto merged
sql/sql_partition.cc:
  Auto merged
2007-12-05 19:39:32 +01:00
unknown
c8969f7156 Bug#30480: Falcon: searches fail if LIKE and key partition
(also fixes the bugs: Bug#29320, Bug#29493 and Bug#30536)

Problem: Partitioning did not handle unordered scans correctly
for engines with unordered read order.

Solution: do not stop scanning fi a recored is out of range, since
there can be more records within the range afterwards.

Note: this is the patch that fixes the bug, but since there are no
storage engines shipped with mysql 5.1 (falcon comes in 6.0) there
are no test cases (it is a separate patch that only goes into 6.0)


sql/ha_partition.cc:
  Bug#30480: Falcon: searches fail if LIKE and key partition
  
  Problem was that partitioning did not handle unordered scans correctly
  for engines with unordered read order.
  
  Solution: do not stop if a recored is out of range, since it can come
  more records within the range afterwards
2007-12-03 16:12:25 +01:00
unknown
b5c0cf454d BUG#32772: partition crash 1: enum column
The bug was that for ordered index scans, ha_partition::index_init() did
not put index columns into table->read_set if the underlying storage 
engine did not have HA_PARTIAL_COLUMN_READ flag. 
This was causing assertion failure when handle_ordered_index_scan() tried
to sort the records according to index order.

Fixed by making ha_partition::index_init() put index columns into table->read_set
for all ordered scans. 


mysql-test/r/partition.result:
  BUG#32772: partition crash 1: enum column
  - Testcase
mysql-test/t/partition.test:
  BUG#32772: partition crash 1: enum column
  - Testcase
sql/ha_partition.cc:
  BUG#32772: partition crash 1: enum column
  - Make ha_partition::index_init() include index columns in the read_set
    whenever an ordered scan is initialized, no matter if
    HA_PARTIAL_COLUMN_READ is set or not.
2007-11-28 03:02:05 +03:00
unknown
7a57359762 Merge hynda.mysql.fi:/home/my/mysql-5.1-main
into  hynda.mysql.fi:/home/my/mysql-5.1-marvel


BitKeeper/etc/ignore:
  auto-union
client/mysqldump.c:
  Auto merged
include/my_sys.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysql/Makefile.shared:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
storage/myisam/mi_dynrec.c:
  Auto merged
2007-11-26 11:27:01 +02:00
unknown
4c31c41fdc Bug#30822: ALTER TABLE COALESCE PARTITION causes segmentation fault
Problem was for LINEAR HASH/KEY. Crashes because of wrong partition id
returned when creating the new altered partitions. (because of wrong
linear hash mask)

Solution: Update the linear hash mask before using it for the new
altered table.


mysql-test/r/partition_hash.result:
  Bug#30822: ALTER TABLE COALESCE PARTITION causes segmentation fault
  
  test result
mysql-test/t/partition_hash.test:
  Bug#30822: ALTER TABLE COALESCE PARTITION causes segmentatition fault
  
  test case
sql/ha_partition.cc:
  Bug#30822: ALTER TABLE COALESCE PARTITION causes segmentation fault
  
  Updating the linear hash mask before using it.
sql/sql_partition.cc:
  Bug#30822: ALTER TABLE COALESCE PARTITION causes segmentation fault
  
  exporting the set_linear_hash_mask function (static -> non static)
sql/sql_partition.h:
  Bug#30822: ALTER TABLE COALESCE PARTITION causes segmentation fault
  
  exporting the set_linear_hash_mask function (static -> non static)
2007-11-20 11:21:00 +01:00
unknown
0b22925cc0 BUG#30573: Ordered range scan over partitioned tables returns some rows twice
The problem: ha_partition::read_range_first() could return a record that is 
outside of the scanned range. If that record happened to be in the next 
subsequent range, it would satisfy the WHERE and appear in the output twice.
(we would get it the second time when scanning the next subsequent range)

Fix: 
Made ha_partition::read_range_first() check if the returned recod is within
the scanned range, like other read_range_first() implementations do.


mysql-test/r/partition_range.result:
  BUG#30573: Ordered range scan over partitioned tables returns some rows twice
   - Testcase
mysql-test/t/partition_range.test:
  BUG#30573: Ordered range scan over partitioned tables returns some rows twice
   - Testcase
sql/ha_partition.cc:
  BUG#30573: Ordered range scan over partitioned tables returns some rows twice
  - Make ha_partition::read_range_first() check if the returned record is 
    within the range.
2007-11-20 05:02:49 +03:00
unknown
94078aa928 Merge hynda.mysql.fi:/home/my/mysql-5.1-main
into  hynda.mysql.fi:/home/my/mysql-5.1-marvel


include/my_sys.h:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
storage/myisam/ft_boolean_search.c:
  Auto merged
storage/myisam/ft_parser.c:
  Auto merged
storage/myisam/mi_check.c:
  Auto merged
2007-11-14 16:32:03 +02:00
unknown
711cf7503d Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


BitKeeper/etc/ignore:
  auto-union
mysql-test/r/events_bugs.result:
  Auto merged
mysql-test/r/partition.result:
  Auto merged
mysql-test/r/ps_2myisam.result:
  Auto merged
mysql-test/r/ps_3innodb.result:
  Auto merged
mysql-test/r/ps_4heap.result:
  Auto merged
mysql-test/r/ps_5merge.result:
  Auto merged
mysql-test/r/sp.result:
  Auto merged
mysql-test/t/partition.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_partition.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_udf.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/r/select.result:
  manual merge
mysql-test/t/select.test:
  manual merge
2007-11-14 17:30:16 +04:00
unknown
6080ae981b Bug #32067 Partitions: crash with timestamp column.
Partition handler fails updating tables with partitioning
based on timestamp field, as it calculates the timestamp field
AFTER it calculates the number of partition of a record.

Fixed by adding timestamp_field->set_time() call and disabling
such consequent calls


mysql-test/r/partition.result:
  Bug #32067 Partitions: crash with timestamp column.
  
  test result
mysql-test/t/partition.test:
  Bug #32067 Partitions: crash with timestamp column.
  
  test case
sql/ha_partition.cc:
  Bug #32067 Partitions: crash with timestamp column.
  
  do timestamp_field->set_time() in the ha_partition::update_row()
2007-11-12 21:11:31 +04:00
unknown
6ac3d502d7 Bug#32091: Security breach via directory changes
Problem: the table's INDEX and DATA DIR was taken
  directly from the table's first partition.
  This allowed rename attack similar to
  bug#32111 when ALTER TABLE REMOVE PARTITIONING

Solution: Silently ignore the INDEX/DATA DIR
  for the table. (Like some other storage engines
  do). 
  Partitioned tables do not support DATA/INDEX
  DIR on the table level, only on its partitions.


mysql-test/r/partition_mgm.result:
  Bug#32091: Security breach via directory changes
  test result
mysql-test/t/partition_mgm.test:
  Bug#32091: Security breach via directory changes
  test case
sql/ha_partition.cc:
  Bug#32091: Security breach via directory changes
  
  Do not use the first partition's DATA/INDEX DIR
  as the table's DATA/INDEX DIR.
  (A partitioned table do not have support for DATA/
  INDEX DIR, only its partitions do)
2007-11-09 23:22:00 +01:00
unknown
0eec2d63d5 Merge hynda.mysql.fi:/home/my/mysql-5.1-main
into  hynda.mysql.fi:/home/my/mysql-5.1-marvel


BitKeeper/etc/ignore:
  auto-union
client/mysql_upgrade.c:
  Auto merged
client/mysqlcheck.c:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqlimport.c:
  Auto merged
client/mysqlshow.c:
  Auto merged
client/mysqlslap.c:
  Auto merged
client/mysqltest.c:
  Auto merged
include/my_global.h:
  Auto merged
include/my_sys.h:
  Auto merged
mysys/mf_keycache.c:
  Auto merged
mysys/my_init.c:
  Auto merged
mysys/safemalloc.c:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
sql/unireg.cc:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_write.c:
  Auto merged
sql/sql_yacc.yy:
  Merged with 5.1 main tree.
2007-11-08 13:23:08 +02:00
unknown
1603139dd5 Merge stella.local:/home2/mydev/mysql-5.1-amain
into  stella.local:/home2/mydev/mysql-5.1-axmrg


mysql-test/r/ctype_ucs.result:
  Auto merged
mysql-test/t/ctype_ucs.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
2007-10-31 13:13:20 +01:00
unknown
95a8bb20fb Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


client/client_priv.h:
  Auto merged
client/mysqldump.c:
  Auto merged
include/config-win.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/func_sapdb.result:
  Auto merged
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/r/variables.result:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_timefunc.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
storage/innobase/handler/ha_innodb.cc:
  Auto merged
storage/myisam/sort.c:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/r/query_cache.result:
  manual merge
mysql-test/include/mix1.inc:
  manual merge
mysql-test/r/innodb_mysql.result:
  manual merge
mysql-test/r/type_datetime.result:
  manual merge
mysql-test/r/type_decimal.result:
  manual merge
mysql-test/t/query_cache.test:
  manual merge
mysql-test/t/type_datetime.test:
  manual merge
mysql-test/t/type_decimal.test:
  manual merge
sql/item.cc:
  manual merge
2007-10-23 19:08:21 +05:00
unknown
bfc41161b4 Bug #30878: Crashing when alter an auto_increment non partitioned
table to partitioned

Problem:
Crashed because usage of an uninitialised mutex when auto_incrementing
  a partitioned temporary table

Fix:
Only locking (using the mutex) if not temporary table.


mysql-test/r/partition.result:
  Bug #30878: Crashing when alter an auto_increment non partitioned
    table to partitioned
  test result
mysql-test/t/partition.test:
  Bug #30878: Crashing when alter an auto_increment non partitioned
    table to partitioned
  testcase
sql/ha_partition.cc:
  Bug #30878: Crashing when alter an auto_increment non partitioned
    table to partitioned
  
  If the table is a temporary table, the table_share->mutex is not
    initialised.
  
  Checking if not temporary table, then OK to lock (else no need
    to lock)
2007-10-17 20:40:23 +02:00
unknown
fb84f573ad Moved a lot of old bug fixes and safe cleanups from Maria 5.1 tree to 5.1
- Reserver namespace and place in frm for TABLE_CHECKSUM and PAGE_CHECKSUM create options
- Added syncing of directory when creating .frm files
- Portability fixes
- Added missing cast that could cause bugs
- Code cleanups
- Made some bit functions inline
- Moved things out of myisam.h to my_handler.h to make them more accessable
- Renamed some myisam variables and defines to make them more globaly usable (as they are used outside of MyISAM)
- Fixed bugs in error conditions
- Use compiler time asserts instead of run time
- Fixed indentation
HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_PREPARE_FOR_DROP as the old name was wrong
(Added a define for old value to ensure we don't break any old code)
Added HA_EXTRA_PREPARE_FOR_RENAME as a signal for rename (before we used a DROP signal which is wrong)
- Initialize error messages early to get better errors when mysqld or an engine fails to start
- Fix windows bug that query_performance_frequency was not initialized if registry code failed
- thread_stack -> my_thread_stack_size


BitKeeper/etc/ignore:
  added libmysqld/scheduler.cc libmysqld/sql_connect.cc libmysqld/sql_tablespace.cc
include/Makefile.am:
  Added my_bit.h
include/m_string.h:
  Added bzero_if_purify() to simplify code
include/my_base.h:
  Reserve options for the future
  Added HA_OPTION_NULL_FIELDS, HA_OPTION_PAGE_CHECKSUM, HA_CREATE_PAGE_CHECKSUM
  Added new error message HA_ERR_NEW_FILE
  Added optional new row type BLOCK_RECORD
  Renamed HA_EXTRA_PREPARE_FOR_DELETE to HA_EXTRA_PREPARE_FOR_DROP
  Added HA_EXTRA_PREARE_FOR_RENAME to inform handler we will do a rename
  (Added define to make things compatible until 6.0)
  Moved invalidator_by_filename form myisam.h
include/my_dbug.h:
  Poirtablity fix
include/my_global.h:
  Added helper macros STATIC_INLINE and MY_ERRPTR
  Added NEED_EXPLICIT_SYNC_DIR
include/my_handler.h:
  Added missing casts
  Moved some constants and macros out from myisam.h to make these generally available
  Renamed mi_compare_text() to ha_compare_text() as this function is not myisam specific
  Renamed mi_portable_sizeof_char_ptr to portable_sizeof_char_ptr
  Added registering of handler messages for better error reporting during startup
include/my_sys.h:
  Added my_sync_dir() and my_sync_dir_by_file()
  More comments
  Some indentation fixes
  Moved bit functions to my_bit.h
  Added prototype for crc32()
include/myisam.h:
  Moved things from here to my_handler.h to make them more accessable
libmysql/Makefile.shared:
  Added my_sync
mysys/array.c:
  Fixed indentation and spelling errors
  Split set_dynamic() to two functions
  Added allocate_dynamic() as a new visiable function
  (no new code, only refactoring)
mysys/mf_iocache.c:
  More DBUG
mysys/mf_keycache.c:
  More explicite ASSERT
  Removed some casts
  Fixed indentation
mysys/mf_tempfile.c:
  Fixed bug with possible dangling file descriptor
mysys/my_atomic.c:
  Use compile time asserts instead of run time
mysys/my_bit.c:
  Make most bit functions inline
mysys/my_bitmap.c:
  Added my_bit.h
mysys/my_compress.c:
  Fixed indentation
mysys/my_create.c:
  Added my_sync_by_dir()
mysys/my_delete.c:
  Added my_sync_by_dir()
mysys/my_error.c:
  init_glob_errs() is now done in my_init()
mysys/my_handler.c:
  mi_compare_text() -> ha_compare_text() as this is not MyISAM specific
  Added functions to initialize handler error messages
  Fixed indentation
  More clear usage of include files
mysys/my_init.c:
  Added my_thread_stack_size to be used by other programs
  Ensure that global error messages are always initialized
  Fix windows bug that query_performance_frequency was not initialized if registry code failed
mysys/my_open.c:
  More comments
  Removed duplicate code
mysys/my_pread.c:
  Ensure that my_errno is set even if errno is 0
mysys/my_realloc.c:
  Added comment
mysys/my_rename.c:
  Added syncing of directories
mysys/my_symlink.c:
  Added my_sync_by_dir()
mysys/my_sync.c:
  Added my_sync_dir()
   
  On recent Mac OS X, fcntl(F_FULLFSYNC) is recommended over fsync()
  (see "man fsync" on Mac OS X 10.3).
  my_sync_dir(): to sync a directory after a file creation/deletion/
  renaming; can be called directly or via MY_SYNC_DIR in my_create/
  my_delete/my_rename(). No-op except on Linux (see "man fsync" on Linux).
  my_sync_dir_from_file(): same as above, just more practical when the
  caller has a file name but no directory name ready.
  Should the #warning even be a #error? I mean do we want to release
  binaries which don't guarantee any durability?
mysys/safemalloc.c:
  Added sf_malloc_report_allocated() (Debugging aid)
sql/gen_lex_hash.cc:
  Remove inline for big function
sql/ha_partition.cc:
  HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_PREPARE_FOR_DROP
  prepare_for_delete -> prepare_for_rename() as this is the the time this function is called
sql/ha_partition.h:
  prepare_for_delete -> prepare_for_rename() as this is the the time this function is called
sql/handler.cc:
  ha_init_errors() is now called at startup before plugins
  This allows us to get better error messages
sql/handler.h:
  Reserve enum value for Maria
  Add future proof enum for page checksums
sql/item_func.cc:
  Include my_bit.h
sql/lex.h:
  Added future proof CREATE table options
sql/log.cc:
  Added comment
sql/mysql_priv.h:
  thread_stack moved to mysys
sql/mysqld.cc:
  thread_stack moved to mysys
  thread_stack -> my_thread_stack_size
  Initialize myisam key caches before plugins starts
  Initialize error to allow storage engine to give better error messages if init failes.
  Fixed indentation
  Group all MyISAM options together
  Added new status variable 'Opened_table_definitions' to allow one to monitor if table definition cache is too small
  Clarified some option help messages
sql/opt_range.cc:
  Removed wrong usage of SAFE_MODE (this disabled key usage for UPDATES, which was never the intention)
  Removed print if total cost in a place where it didn't have any usable value
sql/set_var.cc:
  thread_stack -> my_thread_stack
sql/sql_class.cc:
  Intialize transaction object properly
sql/sql_parse.cc:
  thread_stack -> my_thread_stack
sql/sql_select.cc:
  Include my_bit.h
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
sql/sql_show.cc:
  Simplify handling of ha_choice variables
  Added future safe PAGE_CHECKSUM option
  Addid missing 'transactional=#' in information schema
sql/sql_table.cc:
  HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_FORCE_REOPEN when doing reopen
  HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_PREPARE_FOR_RENAME when doing rename
  Removed not needed initialization
sql/sql_test.cc:
  thread_stack -> my_thread_stack
sql/sql_yacc.yy:
  Simplify handling of ha_choice variables
  Added future proof create table options TABLE_CHECKSUM=# & PAGE_CHECKSUM=#
sql/table.cc:
  Save page_checksum in .frm
sql/table.h:
  Added variable to hold create table option PAGE_CHECKSUM
sql/unireg.cc:
  Added syncing of directories
storage/myisam/ft_boolean_search.c:
  mi_compare_text() -> ha_compare_text()
storage/myisam/ft_eval.c:
  mi_compare_text() -> ha_compare_text()
storage/myisam/ft_nlq_search.c:
  mi_compare_text() -> ha_compare_text()
storage/myisam/ft_parser.c:
  mi_compare_text() -> ha_compare_text()
storage/myisam/ft_stopwords.c:
  mi_compare_text() -> ha_compare_text()
storage/myisam/ft_test1.c:
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisam/ft_update.c:
  mi_compare_text() -> ha_compare_text()
storage/myisam/ha_myisam.cc:
  Include my_bit.h
storage/myisam/mi_check.c:
  MI_MAX_POSSIBLE_KEY_BUFF -> HA_MAX_POSSIBLE_KEY_BUFF
  mi_compare_text() -> ha_compare_text()
  Added BLOCK_RECORD to avoid compiler warnings
storage/myisam/mi_checksum.c:
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisam/mi_create.c:
  MI_MAX_POSSIBLE_KEY -> HA_MAX_POSSIBLE_KEY
  MI_MAX_KEY_BLOCK_SIZE -> HA_MAX_KEY_BLOCK_SIZE
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisam/mi_dynrec.c:
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisam/mi_extra.c:
  HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_PREPARE_FOR_DROP
storage/myisam/mi_open.c:
  MI_MAX_POSSIBLE_KEY -> HA_MAX_POSSIBLE_KEY
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisam/mi_packrec.c:
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisam/mi_range.c:
  mi_compare_text -> ha_compare_text
storage/myisam/mi_test1.c:
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisam/mi_test2.c:
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisam/mi_unique.c:
  mi_compare_text() -> ha_compare_text()
storage/myisam/mi_write.c:
  mi_compare_text() -> ha_compare_text()
storage/myisam/myisamchk.c:
  Include my_bit.h
storage/myisam/myisamdef.h:
  Moved store_key_length_inc to handler.h
storage/myisam/myisampack.c:
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisam/sp_test.c:
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisammrg/ha_myisammrg.cc:
  HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_PREPARE_FOR_DROP
include/my_bit.h:
  New BitKeeper file ``include/my_bit.h''
2007-10-11 18:07:40 +03:00
unknown
da804f3088 Merge stella.local:/home2/mydev/mysql-5.1-amain
into  stella.local:/home2/mydev/mysql-5.1-axmrg


configure.in:
  Auto merged
sql/ha_partition.cc:
  Auto merged
2007-10-10 21:25:19 +02:00
unknown
2dd78add6b Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


libmysql/libmysql.c:
  Auto merged
mysql-test/include/mix1.inc:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2007-10-10 14:33:46 +05:00
unknown
ceadd59644 Merge janus.mylan:/usr/home/serg/Abk/mysql-5.1
into  janus.mylan:/usr/home/serg/Abk/mysql-maria1


Makefile.am:
  Auto merged
client/mysqldump.c:
  Auto merged
configure.in:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
mysys/mf_tempfile.c:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/ha_partition.h:
  Auto merged
sql/handler.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
BUILD/compile-dist:
  SCCS merged
2007-10-08 21:01:44 +02:00
unknown
9d87e8f86a Merge bk@192.168.21.1:mysql-5.1-opt
into  mysql.com:/home/hf/work/26527/my51-26527


sql/ha_partition.cc:
  Auto merged
2007-10-05 14:21:59 +05:00
unknown
b4d566a053 Bug #30484: Partitions: crash with self-referencing trigger
Two cases in ha_partition::extra() was missing
(HA_EXTRA_DELETE_CANNOT_BATCH and HA_EXTRA_UPDATE_CANNOT_BATCH)
which only is currently used by NDB (which not uses ha_partition)


mysql-test/r/partition.result:
  Added result for test of Bug #30484
mysql-test/t/partition.test:
  Added test for Bug #30484
sql/ha_partition.cc:
  Added HA_EXTRA_DELETE_CANNOT_BATCH and HA_EXTRA_UPDATE_CANNOT_BATCH
  in ha_partition::extra to do nothing
  (Only currently used in NDB, which is not dependent of ha_partition)
2007-10-04 14:56:33 +02:00
unknown
82e6e6fb66 Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG30583/mysql-5.1-engines


sql/ha_partition.cc:
  Auto merged
2007-10-01 14:23:16 +05:00
unknown
f4afcec393 Merge hynda.mysql.fi:/home/my/mysql-5.1-main
into  hynda.mysql.fi:/home/my/mysql-maria


BitKeeper/etc/ignore:
  auto-union
BUILD/SETUP.sh:
  Auto merged
BitKeeper/deleted/.del-CMakeLists.txt~99a50df6:
  Auto merged
Makefile.am:
  Auto merged
client/mysqldump.c:
  Auto merged
configure.in:
  Auto merged
include/Makefile.am:
  Auto merged
include/keycache.h:
  Auto merged
include/m_string.h:
  Auto merged
include/my_sys.h:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
  Auto merged
mysql-test/lib/mtr_cases.pl:
  Auto merged
mysql-test/lib/mtr_misc.pl:
  Auto merged
mysql-test/lib/mtr_process.pl:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Auto merged
mysql-test/lib/mtr_timer.pl:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/alter_table.result:
  Auto merged
mysql-test/r/merge.result:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/r/query_cache.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/suite/ndb/r/ps_7ndb.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_events.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_insert.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_row_insert_delayed.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result:
  Auto merged
mysql-test/suite/rpl/t/rpl_insert.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test:
  Auto merged
mysql-test/t/alter_table.test:
  Auto merged
mysql-test/t/myisam.test:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
mysql-test/t/query_cache.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/view.test:
  Auto merged
mysys/array.c:
  Auto merged
mysys/mf_keycache.c:
  Auto merged
mysys/my_init.c:
  Auto merged
mysys/my_symlink2.c:
  Auto merged
mysys/safemalloc.c:
  Auto merged
mysys/thr_lock.c:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/ha_partition.h:
  Auto merged
sql/handler.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_xmlfunc.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/net_serv.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/slave.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
sql/sql_test.cc:
  Auto merged
sql/table.h:
  Auto merged
sql/udf_example.c:
  Auto merged
sql/uniques.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
storage/csv/ha_tina.h:
  Auto merged
storage/myisam/ft_boolean_search.c:
  Auto merged
storage/myisam/ft_nlq_search.c:
  Auto merged
storage/myisam/ft_parser.c:
  Auto merged
storage/myisam/ft_stopwords.c:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/ha_myisam.h:
  Auto merged
storage/myisam/mi_check.c:
  Auto merged
storage/myisam/mi_create.c:
  Auto merged
storage/myisam/mi_delete.c:
  Auto merged
storage/myisam/mi_dynrec.c:
  Auto merged
storage/myisam/mi_extra.c:
  Auto merged
storage/myisam/mi_key.c:
  Auto merged
storage/myisam/mi_locking.c:
  Auto merged
storage/myisam/mi_log.c:
  Auto merged
storage/myisam/mi_packrec.c:
  Auto merged
storage/myisam/mi_rkey.c:
  Auto merged
storage/myisam/mi_search.c:
  Auto merged
storage/myisam/mi_test1.c:
  Auto merged
storage/myisam/mi_test2.c:
  Auto merged
storage/myisam/mi_update.c:
  Auto merged
storage/myisam/mi_write.c:
  Auto merged
storage/myisam/myisamchk.c:
  Auto merged
storage/myisam/myisamlog.c:
  Auto merged
storage/myisam/myisampack.c:
  Auto merged
storage/myisam/sort.c:
  Auto merged
storage/myisam/sp_test.c:
  Auto merged
storage/myisammrg/ha_myisammrg.cc:
  Auto merged
storage/myisammrg/ha_myisammrg.h:
  Auto merged
storage/ndb/src/mgmapi/mgmapi.cpp:
  Auto merged
support-files/compiler_warnings.supp:
  Auto merged
client/mysqltest.c:
  Manual merge between mysql-5.1 and mysql-maria
include/my_base.h:
  Manual merge between mysql-5.1 and mysql-maria
include/my_global.h:
  Manual merge between mysql-5.1 and mysql-maria
include/myisam.h:
  Manual merge between mysql-5.1 and mysql-maria
libmysql/Makefile.shared:
  Manual merge between mysql-5.1 and mysql-maria
mysql-test/r/events_logs_tests.result:
  Manual merge between mysql-5.1 and mysql-maria
mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result:
  Manual merge between mysql-5.1 and mysql-maria
mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test:
  Manual merge between mysql-5.1 and mysql-maria
mysql-test/t/disabled.def:
  Manual merge between mysql-5.1 and mysql-maria
mysql-test/t/events_logs_tests.test:
  Manual merge between mysql-5.1 and mysql-maria
mysys/my_compress.c:
  Manual merge between mysql-5.1 and mysql-maria
mysys/my_getsystime.c:
  Manual merge between mysql-5.1 and mysql-maria
mysys/my_open.c:
  Manual merge between mysql-5.1 and mysql-maria
sql/handler.cc:
  Manual merge between mysql-5.1 and mysql-maria
sql/set_var.h:
  Manual merge between mysql-5.1 and mysql-maria
sql/sql_class.h:
  Manual merge between mysql-5.1 and mysql-maria
sql/sql_show.cc:
  Manual merge between mysql-5.1 and mysql-maria
sql/sql_sort.h:
  Manual merge between mysql-5.1 and mysql-maria
sql/sql_yacc.yy:
  Manual merge between mysql-5.1 and mysql-maria
sql/table.cc:
  Manual merge between mysql-5.1 and mysql-maria
storage/csv/ha_tina.cc:
  Manual merge between mysql-5.1 and mysql-maria
storage/myisam/mi_open.c:
  Manual merge between mysql-5.1 and mysql-maria
storage/myisam/myisamdef.h:
  Manual merge between mysql-5.1 and mysql-maria
unittest/mysys/my_atomic-t.c:
  Manual merge between mysql-5.1 and mysql-maria
2007-09-27 17:05:07 +03:00
unknown
1f1975681b Merge jbruehe@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22
into  trift-lap.fambruehe:/MySQL/M51/antony-5.1


mysql-test/suite/funcs_1/include/ndb_tb2.inc:
  Auto merged
mysql-test/suite/funcs_1/r/innodb_views.result:
  Auto merged
mysql-test/suite/funcs_1/r/memory_views.result:
  Auto merged
mysql-test/suite/funcs_1/r/myisam_views.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_cursors.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_func_view.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_storedproc_07.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_storedproc_08.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_trig_0102.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_trig_03.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_trig_03e.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_trig_0407.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_trig_08.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_trig_09.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result:
  Auto merged
mysql-test/suite/funcs_1/r/ndb_views.result:
  Auto merged
mysql-test/suite/funcs_1/views/views_master.inc:
  Auto merged
sql/ha_partition.h:
  Auto merged
storage/innobase/handler/ha_innodb.cc:
  Auto merged
configure.in:
  Version is updated already.
sql/ha_partition.cc:
  Manual merge of 5.1.22 changes into main.
2007-09-24 15:33:46 +02:00
unknown
fc7a9058f1 BUG#30583 - Partition on DOUBLE key + INNODB + count(*) == crash
Issuing SELECT COUNT(*) against partitioned InnoDB table may cause
server crash.

Fixed that not all required fields were included into read_set.


mysql-test/r/partition_innodb.result:
  A test case for BUG#30583.
mysql-test/t/partition_innodb.test:
  A test case for BUG#30583.
sql/ha_partition.cc:
  Ensure that all fields of current key are included into read_set,
  as partitioning requires them for sorting
  (see ha_partition::handle_ordered_index_scan).
2007-09-13 18:33:40 +05:00
unknown
1e3be8ca64 Merge bk@192.168.21.1:mysql-5.1-opt
into  mysql.com:/home/hf/work/28430/my51-28430


sql/ha_partition.h:
  Auto merged
sql/ha_partition.cc:
  merging
sql/log_event.cc:
  merging
2007-09-10 10:21:55 +05:00