Commit graph

241 commits

Author SHA1 Message Date
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
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
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
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
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
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
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