1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-19 22:42:44 +03:00
Commit Graph

109 Commits

Author SHA1 Message Date
sunny
2016ae3262 branches/5.1: Fix Bug#42714 AUTO_INCREMENT errors in 5.1.31. There are two
changes to the autoinc handling.

1. To fix the immediate problem from the bug report, we must ensure that the
   value written to the table is always less than the max value stored in
   dict_table_t.

2. The second related change is that according to MySQL documentation when
   the offset is greater than the increment, we should ignore the offset.
2009-02-25 03:32:01 +00:00
vasil
fe8fbb1e4f branches/5.1:
Merge a change from MySQL:

[looks like the changes to innodb-autoinc.test were made as part of
the following huge merge, but we are merging only changes to that file]

  ------------------------------------------------------------
  revno: 2546.47.1
  committer: Luis Soares <luis.soares@sun.com>
  branch nick: 5.1-rpl
  timestamp: Fri 2009-01-23 13:22:05 +0100
  message:
    merge: 5.1 -> 5.1-rpl
    conflicts:
      Text conflict in client/mysqltest.cc
      Text conflict in mysql-test/include/wait_until_connected_again.inc
      Text conflict in mysql-test/lib/mtr_report.pm
      Text conflict in mysql-test/mysql-test-run.pl
      Text conflict in mysql-test/r/events_bugs.result
      Text conflict in mysql-test/r/log_state.result
      Text conflict in mysql-test/r/myisam_data_pointer_size_func.result
      Text conflict in mysql-test/r/mysqlcheck.result
      Text conflict in mysql-test/r/query_cache.result
      Text conflict in mysql-test/r/status.result
      Text conflict in mysql-test/suite/binlog/r/binlog_index.result
      Text conflict in mysql-test/suite/binlog/r/binlog_innodb.result
      Text conflict in mysql-test/suite/rpl/r/rpl_packet.result
      Text conflict in mysql-test/suite/rpl/t/rpl_packet.test
      Text conflict in mysql-test/t/disabled.def
      Text conflict in mysql-test/t/events_bugs.test
      Text conflict in mysql-test/t/log_state.test
      Text conflict in mysql-test/t/myisam_data_pointer_size_func.test
      Text conflict in mysql-test/t/mysqlcheck.test
      Text conflict in mysql-test/t/query_cache.test
      Text conflict in mysql-test/t/rpl_init_slave_func.test
      Text conflict in mysql-test/t/status.test
  removed:
    mysql-test/suite/parts/r/partition_bit_ndb.result
    mysql-test/suite/parts/t/partition_bit_ndb.test
    mysql-test/suite/parts/t/partition_sessions.test
    mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc
    mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result
    mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result
    mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test
    mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test
    mysql-test/t/log_bin_trust_function_creators_func-master.opt
    mysql-test/t/rpl_init_slave_func-slave.opt
  added:
    mysql-test/include/check_events_off.inc
    mysql-test/include/cleanup_fake_relay_log.inc
    mysql-test/include/have_simple_parser.inc
    mysql-test/include/no_running_event_scheduler.inc
    mysql-test/include/no_running_events.inc
    mysql-test/include/running_event_scheduler.inc
    mysql-test/include/setup_fake_relay_log.inc
    mysql-test/include/wait_condition_sp.inc
    mysql-test/r/fulltext_plugin.result
    mysql-test/r/have_simple_parser.require
    mysql-test/r/innodb_bug38231.result
    mysql-test/r/innodb_bug39438.result
    mysql-test/r/innodb_mysql_rbk.result
    mysql-test/r/partition_innodb_semi_consistent.result
    mysql-test/r/query_cache_28249.result
    mysql-test/r/status2.result
    mysql-test/std_data/bug40482-bin.000001
    mysql-test/suite/binlog/r/binlog_innodb_row.result
    mysql-test/suite/binlog/t/binlog_innodb_row.test
    mysql-test/suite/rpl/r/rpl_binlog_corruption.result
    mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt
    mysql-test/suite/rpl/t/rpl_binlog_corruption.test
    mysql-test/suite/sys_vars/r/tmp_table_size_basic.result
    mysql-test/suite/sys_vars/t/tmp_table_size_basic.test
    mysql-test/t/fulltext_plugin-master.opt
    mysql-test/t/fulltext_plugin.test
    mysql-test/t/innodb_bug38231.test
    mysql-test/t/innodb_bug39438-master.opt
    mysql-test/t/innodb_bug39438.test
    mysql-test/t/innodb_mysql_rbk-master.opt
    mysql-test/t/innodb_mysql_rbk.test
    mysql-test/t/partition_innodb_semi_consistent-master.opt
    mysql-test/t/partition_innodb_semi_consistent.test
    mysql-test/t/query_cache_28249.test
    mysql-test/t/status2.test
  renamed:
    mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result => mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result
    mysql-test/suite/funcs_1/t/is_collation_character_set_applicability.test => mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test
  modified:
    .bzr-mysql/default.conf
    CMakeLists.txt
    client/mysql.cc
    client/mysql_upgrade.c
    client/mysqlcheck.c
    client/mysqltest.cc
    configure.in
    extra/resolve_stack_dump.c
    extra/yassl/include/openssl/ssl.h
    include/config-win.h
    include/m_ctype.h
    include/my_global.h
    mysql-test/extra/binlog_tests/database.test
    mysql-test/extra/rpl_tests/rpl_auto_increment.test
    mysql-test/include/commit.inc
    mysql-test/include/have_32bit.inc
    mysql-test/include/have_64bit.inc
    mysql-test/include/index_merge1.inc
    mysql-test/include/linux_sys_vars.inc
    mysql-test/include/windows_sys_vars.inc
    mysql-test/lib/mtr_report.pm
    mysql-test/mysql-test-run.pl
    mysql-test/r/alter_table.result
    mysql-test/r/commit_1innodb.result
    mysql-test/r/create.result
    mysql-test/r/csv.result
    mysql-test/r/ctype_ucs.result
    mysql-test/r/date_formats.result
    mysql-test/r/events_bugs.result
    mysql-test/r/events_scheduling.result
    mysql-test/r/fulltext.result
    mysql-test/r/func_if.result
    mysql-test/r/func_in.result
    mysql-test/r/func_str.result
    mysql-test/r/func_time.result
    mysql-test/r/grant.result
    mysql-test/r/index_merge_myisam.result
    mysql-test/r/information_schema.result
    mysql-test/r/innodb-autoinc.result
    mysql-test/r/innodb.result
    mysql-test/r/innodb_mysql.result
    mysql-test/r/log_bin_trust_function_creators_func.result
    mysql-test/r/log_state.result
    mysql-test/r/myisampack.result
    mysql-test/r/mysql.result
    mysql-test/r/mysqlcheck.result
    mysql-test/r/partition_datatype.result
    mysql-test/r/partition_mgm.result
    mysql-test/r/partition_pruning.result
    mysql-test/r/query_cache.result
    mysql-test/r/read_buffer_size_basic.result
    mysql-test/r/read_rnd_buffer_size_basic.result
    mysql-test/r/rpl_init_slave_func.result
    mysql-test/r/select.result
    mysql-test/r/status.result
    mysql-test/r/strict.result
    mysql-test/r/temp_table.result
    mysql-test/r/type_bit.result
    mysql-test/r/type_date.result
    mysql-test/r/type_float.result
    mysql-test/r/warnings_engine_disabled.result
    mysql-test/r/xml.result
    mysql-test/suite/binlog/r/binlog_database.result
    mysql-test/suite/binlog/r/binlog_index.result
    mysql-test/suite/binlog/r/binlog_innodb.result
    mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
    mysql-test/suite/binlog/t/binlog_innodb.test
    mysql-test/suite/funcs_1/r/is_columns_is.result
    mysql-test/suite/funcs_1/r/is_engines.result
    mysql-test/suite/funcs_1/r/storedproc.result
    mysql-test/suite/funcs_1/storedproc/param_check.inc
    mysql-test/suite/funcs_2/t/disabled.def
    mysql-test/suite/ndb/t/disabled.def
    mysql-test/suite/parts/r/partition_bit_innodb.result
    mysql-test/suite/parts/r/partition_bit_myisam.result
    mysql-test/suite/parts/r/partition_special_innodb.result
    mysql-test/suite/parts/t/disabled.def
    mysql-test/suite/parts/t/partition_special_innodb.test
    mysql-test/suite/parts/t/partition_value_innodb.test
    mysql-test/suite/parts/t/partition_value_myisam.test
    mysql-test/suite/parts/t/partition_value_ndb.test
    mysql-test/suite/rpl/r/rpl_auto_increment.result
    mysql-test/suite/rpl/r/rpl_packet.result
    mysql-test/suite/rpl/r/rpl_row_create_table.result
    mysql-test/suite/rpl/r/rpl_slave_skip.result
    mysql-test/suite/rpl/r/rpl_trigger.result
    mysql-test/suite/rpl/t/disabled.def
    mysql-test/suite/rpl/t/rpl_packet.test
    mysql-test/suite/rpl/t/rpl_row_create_table.test
    mysql-test/suite/rpl/t/rpl_slave_skip.test
    mysql-test/suite/rpl/t/rpl_trigger.test
    mysql-test/suite/rpl_ndb/t/disabled.def
    mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc
    mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc
    mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result
    mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result
    mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result
    mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result
    mysql-test/t/alter_table.test
    mysql-test/t/create.test
    mysql-test/t/csv.test
    mysql-test/t/ctype_ucs.test
    mysql-test/t/date_formats.test
    mysql-test/t/disabled.def
    mysql-test/t/events_bugs.test
    mysql-test/t/events_scheduling.test
    mysql-test/t/fulltext.test
    mysql-test/t/func_if.test
    mysql-test/t/func_in.test
    mysql-test/t/func_str.test
    mysql-test/t/func_time.test
    mysql-test/t/grant.test
    mysql-test/t/information_schema.test
    mysql-test/t/innodb-autoinc.test
    mysql-test/t/innodb.test
    mysql-test/t/innodb_mysql.test
    mysql-test/t/log_bin_trust_function_creators_func.test
    mysql-test/t/log_state.test
    mysql-test/t/myisam_data_pointer_size_func.test
    mysql-test/t/myisampack.test
    mysql-test/t/mysql.test
    mysql-test/t/mysqlcheck.test
    mysql-test/t/partition_innodb_stmt.test
    mysql-test/t/partition_mgm.test
    mysql-test/t/partition_pruning.test
    mysql-test/t/query_cache.test
    mysql-test/t/rpl_init_slave_func.test
    mysql-test/t/select.test
    mysql-test/t/status.test
    mysql-test/t/strict.test
    mysql-test/t/temp_table.test
    mysql-test/t/type_bit.test
    mysql-test/t/type_date.test
    mysql-test/t/type_float.test
    mysql-test/t/warnings_engine_disabled.test
    mysql-test/t/xml.test
    mysys/my_getopt.c
    mysys/my_init.c
    scripts/mysql_install_db.sh
    sql-common/my_time.c
    sql/field.cc
    sql/field.h
    sql/filesort.cc
    sql/ha_partition.cc
    sql/ha_partition.h
    sql/item.cc
    sql/item_cmpfunc.cc
    sql/item_func.h
    sql/item_strfunc.cc
    sql/item_sum.cc
    sql/item_timefunc.cc
    sql/item_timefunc.h
    sql/log.cc
    sql/log.h
    sql/log_event.cc
    sql/log_event.h
    sql/mysql_priv.h
    sql/mysqld.cc
    sql/opt_range.cc
    sql/partition_info.cc
    sql/repl_failsafe.cc
    sql/rpl_constants.h
    sql/set_var.cc
    sql/slave.cc
    sql/spatial.h
    sql/sql_acl.cc
    sql/sql_base.cc
    sql/sql_binlog.cc
    sql/sql_class.h
    sql/sql_cursor.cc
    sql/sql_delete.cc
    sql/sql_lex.cc
    sql/sql_lex.h
    sql/sql_locale.cc
    sql/sql_parse.cc
    sql/sql_partition.cc
    sql/sql_plugin.cc
    sql/sql_plugin.h
    sql/sql_profile.cc
    sql/sql_repl.cc
    sql/sql_select.cc
    sql/sql_select.h
    sql/sql_show.cc
    sql/sql_table.cc
    sql/sql_trigger.cc
    sql/sql_trigger.h
    sql/table.cc
    sql/table.h
    sql/unireg.cc
    storage/csv/ha_tina.cc
    storage/federated/ha_federated.cc
    storage/heap/ha_heap.cc
    storage/innobase/Makefile.am
    storage/innobase/btr/btr0sea.c
    storage/innobase/buf/buf0lru.c
    storage/innobase/dict/dict0dict.c
    storage/innobase/dict/dict0mem.c
    storage/innobase/handler/ha_innodb.cc
    storage/innobase/handler/ha_innodb.h
    storage/innobase/include/btr0sea.h
    storage/innobase/include/dict0dict.h
    storage/innobase/include/dict0mem.h
    storage/innobase/include/ha_prototypes.h
    storage/innobase/include/lock0lock.h
    storage/innobase/include/row0mysql.h
    storage/innobase/include/sync0sync.ic
    storage/innobase/include/ut0ut.h
    storage/innobase/lock/lock0lock.c
    storage/innobase/os/os0file.c
    storage/innobase/plug.in
    storage/innobase/row/row0mysql.c
    storage/innobase/row/row0sel.c
    storage/innobase/srv/srv0srv.c
    storage/innobase/srv/srv0start.c
    storage/innobase/ut/ut0ut.c
    storage/myisam/ft_boolean_search.c
    strings/ctype.c
    strings/xml.c
    tests/mysql_client_test.c
    win/configure.js
    mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test
2009-02-08 19:54:25 +00:00
vasil
7b3443d1a1 branches/5.1:
Merge a change from MySQL:

  ------------------------------------------------------------
  revno: 2709.20.31
  committer: Timothy Smith <timothy.smith@sun.com>
  branch nick: 51
  timestamp: Fri 2008-12-19 01:28:51 +0100
  message:
    Disable part of innodb-autoinc.test, because the MySQL server asserts when
    compiled --with-debug, due to bug 39828, "autoinc wraps around when offset and
    increment > 1".  This change should be reverted when that bug is fixed (and a
    a few other minor changes to the test as described in comments).
  modified:
    mysql-test/r/innodb-autoinc.result
    mysql-test/t/innodb-autoinc.test
2009-02-08 19:36:45 +00:00
sunny
64076dc477 branches/5.1: In the last round of AUTOINC cleanup we assumed that AUTOINC
is only defined for integer columns. This caused an assertion failure when
we checked for the maximum value of a column type. We now calculate the
max value for floating-point autoinc columns too.

Fix Bug#42400 - InnoDB autoinc code can't handle floating-point columns
rb://84 and Mantis issue://162
2009-01-29 14:01:36 +00:00
marko
d32440100b branches/5.1: Make
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
a true replacement of SET GLOBAL INNODB_LOCKS_UNSAFE_FOR_BINLOG=1.
This fixes an error that was introduced in r370, causing
semi-consistent read not to not unlock rows in READ COMMITTED mode.
(Bug #41671, Issue #146)

rb://67 approved by Heikki Tuuri
2008-12-22 14:05:19 +00:00
vasil
809a539dce branches/5.1:
Merge a change from MySQL to fix the failing innodb_bug34300 mysql-test:

  main.innodb_bug34300           [ fail ]
  
  mysqltest: At line 11: query 'SET @@max_allowed_packet=16777216' failed: 1621: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
  
  Aborting: main.innodb_bug34300 failed in default mode. 

The changeset is this:

  ------------------------------------------------------------
  revno: 2709.1.10
  committer: Staale Smedseng <staale.smedseng@sun.com>
  branch nick: b22891-51-bugteam
  timestamp: Thu 2008-11-20 08:51:48 +0100
  message:
    A fix for Bug#22891 "session level max_allowed_packet can be
    set but is ignored".
  
    This patch makes @@session.max_allowed_packed and
    @@session.net_buffer_length read-only as suggested in the bug
    report. The user will have to use SET GLOBAL (and reconnect)
    to alter the session values of these variables.
  
    The error string ER_VARIABLE_IS_READONLY is introduced.
  
    Tests are modified accordingly.
  modified:
    mysql-test/r/func_compress.result
    mysql-test/r/max_allowed_packet_basic.result
    mysql-test/r/max_allowed_packet_func.result
    mysql-test/r/net_buffer_length_basic.result
    mysql-test/r/packet.result
    mysql-test/r/union.result
    mysql-test/r/variables.result
    mysql-test/t/func_compress.test
    mysql-test/t/innodb_bug34300.test
    mysql-test/t/max_allowed_packet_basic.test
    mysql-test/t/max_allowed_packet_func.test
    mysql-test/t/net_buffer_length_basic.test
    mysql-test/t/packet.test
    mysql-test/t/union.test
    mysql-test/t/variables.test
    sql/set_var.cc
    sql/set_var.h
    sql/share/errmsg.txt
  ------------------------------------------------------------
2008-12-09 09:21:08 +00:00
calvin
fce0c716fa branches/5.1: revert the changes in r2933
The changes in r2933 causes test failure on Linux.
More investigation is needed for Windows.

Change the followings in innodb-autoinc.result:
  auto-increment-increment
  auto-increment-offset

back to:
  auto_increment_increment
  auto_increment_offset
2008-12-04 17:00:20 +00:00
calvin
b233819195 branches/5.1: correct the result file innodb-autoinc.result
Change the followings:
  auto_increment_increment
  auto_increment_offset

to
  auto-increment-increment
  auto-increment-offset
2008-10-30 00:57:31 +00:00
vasil
12617fa38a branches/5.1:
Merge a change from MySQL (this fixes the failing innodb and
innodb-semi-consistent tests):

  revno: 2757
  committer: Georgi Kodinov <kgeorge@mysql.com>
  branch nick: B39812-5.1-5.1.29-rc
  timestamp: Fri 2008-10-03 15:24:19 +0300
  message:
    Bug #39812: Make statement replication default for 5.1 (to match 5.0)
    
    Make STMT replication default for 5.1.
    Add a default of MIXED into the config files
    Fix the tests that needed MIXED replication mode.
  modified:
    mysql-test/include/mix1.inc
    mysql-test/r/innodb-semi-consistent.result
    mysql-test/r/innodb.result
    mysql-test/r/innodb_mysql.result
    mysql-test/r/tx_isolation_func.result
    mysql-test/t/innodb-semi-consistent.test
    mysql-test/t/innodb.test
    mysql-test/t/tx_isolation_func.test
    sql/mysqld.cc
    support-files/my-huge.cnf.sh
    support-files/my-innodb-heavy-4G.cnf.sh
    support-files/my-large.cnf.sh
    support-files/my-medium.cnf.sh
    support-files/my-small.cnf.sh
2008-10-21 08:07:44 +00:00
sunny
5ad03895b3 branches/5.1: This bug has always existed but was masked by other errors. The
fix for bug# 38839 triggered this bug. When the offset and increment are > 1
we need to calculate the next value taking into consideration the two
variables. Previously we simply assumed they were 1 particularly offset was
never used. MySQL does its own calculation and that's probably why it seemed
to work in the past. We would return what we thought was the correct next
value and then MySQL would recalculate the actual value from that and return
it to the caller (e.g., handler::write_row()). Several new tests have been
added that try and catch some edge cases. The tests exposed a wrap around
error in MySQL next value calculation which was filed as bug#39828. The tests
will need to be updated once MySQL fix that bug.

One good side effect of this fix is that dict_table_t size has been
reduced by 8 bytes because we have moved the autoinc_increment field to
the row_prebuilt_t structure. See review-board for a detailed discussion.

rb://3
2008-10-03 22:48:04 +00:00
vasil
859c2873fc branches/5.1:
Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch

In ha_innobase::info() - do not try to get the free space for a tablespace
which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the
.ibd file is missing for some other reason.

ibd_file_missing and tablespace_discarded are manipulated only in
row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql()
and the manipulation is protected/surrounded by
row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we
do the same in ha_innobase::info() when checking the values of those members
to avoid race conditions. I have tested the code-path with UNIV_DEBUG and
UNIV_SYNC_DEBUG.

Looks like it is not possible to avoid mysqld printing warnings in the
mysql-test case and thus this test innodb_bug39438 must be added to the
list of exceptional test cases that are allowed to print warnings. For this,
the following patch must be applied to the mysql source tree:

  --- cut ---
  === modified file 'mysql-test/lib/mtr_report.pl'
  --- mysql-test/lib/mtr_report.pl	2008-08-12 10:26:23 +0000
  +++ mysql-test/lib/mtr_report.pl	2008-10-01 11:57:41 +0000
  @@ -412,7 +412,10 @@
   
                   # When trying to set lower_case_table_names = 2
                   # on a case sensitive file system. Bug#37402.
  -                /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive.  Now setting lower_case_table_names to 0 to avoid future problems./
  +                /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive.  Now setting lower_case_table_names to 0 to avoid future problems./ or
  +
  +                # this test is expected to print warnings
  +                ($testname eq 'main.innodb_bug39438')
   		)
               {
                 next;                       # Skip these lines
  
  --- cut ---

The mysql-test is currently somewhat disabled (see inside
innodb_bug39438.test), after the above patch has been applied to the mysql
source tree, the test can be enabled.

rb://20

Reviewed by:	Inaam, Calvin
Approved by:	Heikki
2008-10-03 14:17:28 +00:00
vasil
694b0deb94 branches/5.1:
Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK

In TRUNCATE TABLE and discard tablespace: do not remove table-level S
and X locks and do not assert on such locks not being wait locks.
Leave such locks alone.

Approved by:	Heikki (rb://14)
2008-10-01 06:13:13 +00:00
vasil
e3482dd5c2 branches/5.1:
Merge a change from MySQL (fix the failing innodb test):

  ------------------------------------------------------------
  revno: 2646.12.1
  committer: Mattias Jonsson <mattiasj@mysql.com>
  branch nick: wl4176_2-51-bugteam
  timestamp: Mon 2008-08-11 20:02:03 +0200
  message:
    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

I have verified that OPTIMIZE TABLE actually rebuilds the table
and calls ANALYZE.

Approved by:	Heikki
2008-09-09 11:46:17 +00:00
sunny
0e039a4caf branches/5.1: Fix for MySQL Bug#38839. Reset the statement level last
value field in prebuilt. This field tracks the last value in an autoincrement
interval. We use this value to check whether we need to update a table's
AUTOINC counter, if the value written to a table is less than this value
then we avoid updating the table's AUTOINC value in order to reduce
mutex contention. If it's not reset (e.g., after a DELETE statement) then
there is the possibility of missing updates to the table's AUTOINC counter
resulting in a subsequent duplicate row error message under certain 
conditions (see the test case for details).

Bug #38839 - auto increment does not work properly with InnoDB after update
2008-08-23 21:19:05 +00:00
vasil
a1d437b0b3 branches/5.1:
Merge a change from MySQL (this fixes the failing innodb-replace test):

  revno: 2659
  committer: Mattias Jonsson <mattiasj@mysql.com>
  branch nick: b31210-51-bugteam
  timestamp: Tue 2008-06-03 13:25:41 +0200
  message:
    Bug#31210: INSERT DELAYED crashes server when used on partitioned tables
      
    Problem was an unclear error message since it could suggest that
    MyISAM did not support INSERT DELAYED.
    Changed the error message to say that DELAYED is not supported by the
    table, instead of the table's storage engine.
    The confusion is that a partitioned table is in somewhat sense using
    the partitioning storage engine, which in turn uses the ordinary
    storage engine. By saying that the table does not support DELAYED we
    do not give any extra informantion about the storage engine or if it
    is partitioned.
  modified:
    mysql-test/r/innodb-replace.result
    mysql-test/t/innodb-replace.test
    mysql-test/t/merge.test
    mysql-test/t/partition_hash.test
    sql/share/errmsg.txt
    sql/sql_insert.cc
2008-07-01 06:37:34 +00:00
sunny
c4eb6c1758 branches/5.1: Add test cases and fix a bug where the last AUTOINC cached value
was not reset to 0 when the table was truncated.

Bug #37531 : After truncate, auto_increment behaves incorrectly for InnoDB
2008-06-26 12:55:43 +00:00
vasil
d3cb21407d branches/5.1:
Merge change from MySQL (this fixes the failing innodb test):

  ChangeSet@1.2628  2008-05-13 17:01:02+05:00  gshchepa@host.loc
    Merge host.loc:/work/bugs/5.0-bugteam-30059
    into  host.loc:/work/bk/5.1-bugteam

NOTE: the diff for mysql-test/r/innodb.result in this ChangeSet looks
empty but the line:

Data truncated for column 'c' at row 1

is present in annotated mysql-test/r/innodb.result@1.215 [1]
and not present in annotated mysql-test/r/innodb.result@1.216 [2] so it
must have been deleted in the above ChangeSet.

[1] http://mysql.bkbits.net:8080/mysql-5.1/mysql-test/r/innodb.result?PAGE=anno&REV=4825e033JNz_463Ha9pwInSjqLvIQg
[2] http://mysql.bkbits.net:8080/mysql-5.1/mysql-test/r/innodb.result?PAGE=anno&REV=482982fcUoskWjhU2xMH2BZ4Gyukfg
2008-06-09 10:16:51 +00:00
vasil
104f83a5f0 branches/5.1:
Merge change from MySQL (this almost fixes the failing innodb test):

  ChangeSet@1.2613, 2008-05-07 09:58:21+04:00, sergefp@mysql.com +5 -0
    BUG#35850 "Performance regression in 5.1.23/5.1.24"
    - Disable the "prefer full scan on clustered primary key over full scan
      of any secondary key" rule introduced by BUG#35850.
    - Update test results accordingly
    (bk trigger: file this for BUG#35850)
  
    mysql-test/r/innodb.result@1.214, 2008-05-07 09:57:31+04:00, sergefp@mysql.com +15 -15
      BUG#35850 "Performance regression in 5.1.23/5.1.24"
      - Update test results
2008-06-09 09:53:12 +00:00
calvin
ed668cc164 branches/5.1: Fix bug#35537 - Innodb doesn't increment handler_update
and handler_delete

Add the calls to ha_statistic_increment() in ha_innobase::delete_row()
and ha_innobase::update_row().
2008-04-24 11:32:30 +00:00
calvin
6ac1930117 branches/5.1: Fix bug#29507 TRUNCATE shows to many rows effected
In InnoDB, the row count is only a rough estimate used by SQL
optimization. InnoDB is now return row count 0 for TRUNCATE operation.
2008-04-24 11:25:30 +00:00
vasil
be05f50a34 branches/5.1:
Merge change from MySQL (this fixes the failing innodb test):

ChangeSet@1.1810.3601.4, 2008-02-07 02:33:21+04:00, gshchepa@host.loc +9 -0
  Fixed bug#30059.
  Server handles truncation for assignment of too-long values
  into CHAR/VARCHAR/TEXT columns in a different ways when the
  truncated characters are spaces:
  1. CHAR(N) columns silently ignore end-space truncation;
  2. TEXT columns post a truncation warning/error in the
     non-strict/strict mode.
  3. VARCHAR columns always post a truncation note in
     any mode.

  Space truncation processing has been synchronised over
  CHAR/VARCHAR/TEXT columns: current behavior of VARCHAR
  columns has been propagated as standard.

  Binary-encoded string/BLOB columns are not affected.
2008-03-27 05:45:02 +00:00
vasil
063bc007b7 branches/5.1:
Fix Bug#34300 Tinyblob & tinytext fields currupted after export/import and alter in 5.1

Copy the BLOB fields, that are stored internally, to a safe place
(prebuilt->blob_heap) when converting a row from InnoDB format to
MySQL format in row_sel_store_mysql_rec().

The bug was introduced in:

 ------------------------------------------------------------------------
 r587 | osku | 2006-05-23 15:35:58 +0300 (Tue, 23 May 2006) | 3 lines
 
 Optimize BLOB selects by using prebuilt->blob_heap directly instead of first
 reading BLOB data to a temporary heap and then copying it to
 prebuilt->blob_heap.
 ------------------------------------------------------------------------

Approved by:	Heikki
2008-03-26 16:26:54 +00:00
vasil
3fe4b483a4 branches/5.1:
Fix Bug#35220 ALTER TABLE too picky on reserved word "foreign".
 
In ALTER TABLE, change the internal parser to search for
``FOREIGN[[:space:]]'' instead of only ``FOREIGN'' when parsing
ALTER TABLE ... DROP FOREIGN KEY ...; otherwise it could be mistaken
with ALTER TABLE ... DROP foreign_col;
 
Approved by:	Heikki
2008-03-18 07:35:30 +00:00
vasil
713f8b7093 branches/5.1:
Merge changes from MySQL AB.
2008-03-11 16:50:50 +00:00
sunny
4c24bf2cec branches/5.1: Checked in the wrong test results in r2353. This commit has
the correct result set.
2008-03-11 14:20:59 +00:00
sunny
e89ab3bf1d branches/5.1: Change the InnoDB autoinc type to ulint64. For this added a
new typedef to univ.i (ib_ulonglong). Added checks for overflow and removed
the assertion where it crashed previously, since the type has now changed
to unsigned, it doesn't make sense to check for < 0. Added new tests, to
check for overflow, for the different INT types supported for both
signed and unsigned.

Fixes Bug# 34335
2008-03-05 20:23:39 +00:00
sunny
101643c67d branches/5.1: Fix Bug# 34920. We need to use/inherit the passed in autoinc
counter for ALTER TABLE statements too.
2008-03-03 22:50:15 +00:00
vasil
5b92c4ecb8 branches/5.1:
Fix Bug#34053:
* In CREATE TABLE and DROP TABLE check whether the table in question is one
  of the magic innodb_monitor tables and whether the user has enough rights
  to mess with it before doing anything else.
* Implement a mysql-test testcase.

Approved by:	Heikki
2008-02-07 12:02:06 +00:00
marko
fc40679f02 branches/5.1:
innodb.result: Fix results after merging changes from MySQL.  Maybe some
changes were incorrectly merged in the past?
2008-01-28 14:37:09 +00:00
marko
ec0932d075 branches/5.1: Merge a change from MySQL AB:
ChangeSet@2007-11-27 09:25:45+01:00, istruewing@stella.local 
Bug#32754 - InnoDB tests do not prepare or clean up correctly
    
Some test cases were missing preparation to deal with failed
predecessor test cases.
    	  
Added preparation (drop table if exists) to some test cases.

innodb-semi-consistent.test: Added preparation (drop table if exists).
2008-01-28 14:07:57 +00:00
marko
e04e3594f2 branches/5.1: Merge a change from MySQL AB:
ChangeSet@2007-10-13 15:49:42+03:00, aelkin@koti.dsl.inet.fi

Bug #29136 erred multi-delete on trans table does not rollback the statement

innodb.test, innodb.result: trans table specific test added
2008-01-28 14:04:10 +00:00
vasil
e8e7816e5e branches/5.1:
Merge change from MySQL AB:

ChangeSet@1.2639, 2007-11-23 12:51:14+01:00, mkindahl@dl145h.mysql.com +7 -0
  Post-merge fixes.

  mysql-test/r/innodb.result@1.206, 2007-11-23 12:51:10+01:00, mkindahl@dl145h.mysql.com +1 -1
    Result change.
2008-01-04 15:38:59 +00:00
vasil
d34758a239 branches/5.1:
Merge change from MySQL AB:

ChangeSet@1.2616, 2007-12-01 19:55:06+01:00, tnurnberg@mysql.com +8 -0
  Bug#31177: Server variables can't be set to their current values
 
  5.1+ specific fixes (plugins etc.)

  mysql-test/r/innodb.result@1.204, 2007-12-01 19:55:04+01:00, tnurnberg@mysql.com +2 -2
    we throw warnings to the client, yea, verily
2008-01-04 15:29:32 +00:00
vasil
303d1c4091 branches/5.1:
Merge change from MySQL AB:

ChangeSet@1.2557, 2007-11-28 19:43:50+01:00, tnurnberg@mysql.com +21 -0
  Bug#31177: Server variables can't be set to their current values

  Default values of variables were not subject to upper/lower bounds
  and step, while setting variables was. Bounds and step are also
  applied to defaults now; defaults are corrected quietly, values
  given by the user are corrected, and a correction-warning is thrown
  as needed. Lastly, very large values could wrap around, starting
  from 0 again. They are bounded at the maximum value for the
  respective data-type now if no lower maximum is specified in the
  variable's definition.

  mysql-test/r/innodb.result@1.171, 2007-11-28 19:43:48+01:00, tnurnberg@mysql.com +4 -0
    We throw a warning now when we adjust out of range parameters.
2008-01-04 15:17:59 +00:00
vasil
e953b039ea branches/5.1:
Merge change from MySQL AB:

ChangeSet@1.2612, 2007-11-07 19:59:58+04:00, ramil@mysql.com +6 -0
  Fix for bug #26447: "ALTER TABLE .. ORDER" does not work with InnoDB
  and auto_increment keys

  Problems:
    1. ALTER TABLE ... ORDER BY... doesn't make sence if there's a
       user-defined clustered index in the table.
    2. using a secondary index is slower than using a clustered one
       for a table scan.

  Fixes:
    1. raise a warning.
    2. use the clustered index.

  mysql-test/r/innodb.result@1.203, 2007-11-07 19:59:56+04:00, ramil@mysql.com +15 -15
    Fix for bug #26447: "ALTER TABLE .. ORDER" does not work with InnoDB
    and auto_increment keys
      - results adjusted.
2008-01-04 14:45:16 +00:00
vasil
642df820b0 branches/5.1:
Merge change from MySQL AB:

ChangeSet@1.2541, 2007-10-13 15:49:42+03:00, aelkin@koti.dsl.inet.fi +10 -0
  Bug #29136 erred multi-delete on trans table does not rollback the statement
 
  similar to bug_27716, but it was stressed on in the synopsis on that there is another
  side of the artifact affecting behaviour in transaction.

  Fixed with deploying multi_delete::send_error() - otherwise never called - and refining its logic
  to perform binlogging job if needed.

  The changeset includes the following side effects:
  - added tests to check bug_23333's scenarios on the mixture of tables for multi_update;
  - fixes bug@30763 with two-liner patch and a test coinciding to one added for bug_23333.
  
  mysql-test/r/innodb.result@1.171, 2007-10-13 15:49:36+03:00, aelkin@koti.dsl.inet.fi +15 -2
    results changed

  mysql-test/t/innodb.test@1.145, 2007-10-13 15:49:37+03:00, aelkin@koti.dsl.inet.fi +32 -0
    trans table specific test added
2008-01-04 14:18:29 +00:00
marko
88cdf19670 branches/5.1: Merge r2154 from trunk:
innodb.result, innodb.test: Revert the changes in r2145.

The tests that were removed by MySQL

ChangeSet@1.2598.2.6  2007-11-06 15:42:58-07:00  tsmith@hindu.god

were moved to a new test, innodb_autoinc_lock_mode_zero, which is
kept in the MySQL BitKeeper tree.
2007-12-04 08:33:27 +00:00
marko
cd51e62255 Revert the changes that were reverted in r2144 to get a source tree that
is an exact match of a MySQL BitKeeper tree.

Apply r2116:
------------------------------------------------------------------------
r2116 | vasil | 2007-11-23 19:10:17 +0200 (pe, 23 marras 2007) | 6 lines

Set trx->mysql_query_str to NULL at transaction commit.
It could be a problem if someone looks at it after that because MySQL may
have free()d it then.

Approved by:    Heikki (via IM)
------------------------------------------------------------------------

innodb.test, innodb.result:
Add some tests that were apparently accidentally removed in
ChangeSet@1.2598.2.6  2007-11-06 15:42:58-07:00  tsmith@hindu.god
Apply snapshot innodb-5.1-ss1989

ha_innodb.cc: Add a decorative comment.
2007-11-30 12:02:40 +00:00
marko
39d58ce475 Make our 5.1 tree an exact copy of the MySQL source tree.
Revert r2116:
------------------------------------------------------------------------
r2116 | vasil | 2007-11-23 19:10:17 +0200 (pe, 23 marras 2007) | 6 lines

Set trx->mysql_query_str to NULL at transaction commit.
It could be a problem if someone looks at it after that because MySQL may
have free()d it then.

Approved by:    Heikki (via IM)
------------------------------------------------------------------------

innodb.test, innodb.result:
Remove some tests that were apparently accidentally removed in
ChangeSet@1.2598.2.6  2007-11-06 15:42:58-07:00  tsmith@hindu.god
Apply snapshot innodb-5.1-ss1989

ha_innodb.cc: Remove a decorative comment.

This tree should be an exact match of the following MySQL source tree:

bk://mysql.bkbits.net/mysql-5.1
ROOTKEY=3985cf0cwNRCED_XNSCA7RvkLPer2Q
TIPKEY=47447c7cTrSPx22mH8PXNmurrycaaw

bkf changes | head

ChangeSet@1.2634.1.2, 2007-11-21 19:42:50+01:00, df@pippilotta.erinye.com +1 -0
  Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build
  into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build
  MERGE: 1.1810.3425.2

ChangeSet@1.1810.3425.2, 2007-11-21 19:41:13+01:00, df@pippilotta.erinye.com +1 -0
  add wrong warning to suppression file

ChangeSet@1.2634.1.1, 2007-11-21 19:33:27+01:00, df@pippilotta.erinye.com +1 -0
  Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build
  into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build
  MERGE: 1.1810.3425.1

ChangeSet@1.1810.3425.1, 2007-11-21 18:11:08+01:00, df@pippilotta.erinye.com +1 -0
  ignore readline warnings

ChangeSet@1.2635, 2007-11-21 15:06:38+01:00, mleich@five.local.lan +6 -0
  Merge five.local.lan:/work/merge/mysql-5.0-build-30418
  into  five.local.lan:/work/merge/mysql-5.1-build-31610
  MERGE: 1.1810.3284.72
2007-11-30 11:45:26 +00:00
marko
dfa1f85bc6 Merge a change from MySQL AB:
ChangeSet@1.2528.124.3  2007-08-14 15:35:19-06:00  tsmith@hindu.god

Updates to allow innodb.test to be run with --embedded-server,
including a small change to build_table_filename().

innodb.test, innodb.result:

Updates to allow innodb.test to be run with --embedded-server
2007-11-30 09:59:17 +00:00
sunny
0924601f0d Fix for Bug# 31860, in the Bug 16979 fix there was an erroneous assertion that
autoincrement columns can't contain negative values. With the fix, the
autoincrement table counter is set to 0 if the maximum value read from
the autoinc column index is negative.

Add test for the bug fix but the test is not really useful as the server
needs to be restarted half way through the test. It has been added for 
reference only.
2007-10-26 16:51:40 +00:00
marko
62e98cd050 Set an error code when a deadlock occurs in semi-consistent read. (Bug #31494)
innodb-semi-consistent: New tests for InnoDB semi-consistent reads.
Unfortunately, these will not trigger Bug #31494, because there merely
occur lock wait timeouts, not deadlocks.
2007-10-17 05:36:42 +00:00
sunny
767200e61a Add test for Bug# 21409, the actual bug was fixed in r1334. 2007-09-12 23:24:49 +00:00
sunny
29a50ec53c Merge a change from MySQL AB:
ChangeSet@1.2536.50.1  2007-08-02 12:45:56-07:00  igor@mysql.com

Fixed bug#28404.
This patch adds cost estimation for the queries with ORDER BY / GROUP BY
and LIMIT.
If there was a ref/range access to the table whose rows were required
to be ordered in the result set the optimizer always employed this access
though a scan by a different index that was compatible with the required
order could be cheaper to produce the first L rows of the result set.
Now for such queries the optimizer makes a choice between the cheapest
ref/range accesses not compatible with the given order and index scans
compatible with it.

innodb.result: Adjusted results for test cases affected fy the fix for
bug #28404.
2007-09-07 00:04:10 +00:00
marko
8560a8208f innodb.result: Revert r1655, which should have been reverted as part of r1781. 2007-09-03 08:32:32 +00:00
sunny
290b60782e Fix a test case that was broken after Bug#16979 fix. See r1645 and r1735.
The variable used in the tests below was introduced in r1735.
2007-08-30 07:06:27 +00:00
marko
a97acd6ea9 Fix the innodb.test failure mentioned in r1654. 2007-07-31 06:24:44 +00:00
marko
80f54592c6 Merge changes from MySQL AB, as of the following changeset:
ChangeSet@1.2567, 2007-07-27 14:44:31+05:00, svoj@june.mysql.com +3 -0
  Merge mysql.com:/home/svoj/devel/mysql/BUG29957/mysql-5.0-engines
  into  mysql.com:/home/svoj/devel/mysql/BUG29957/mysql-5.1-engines
  MERGE: 1.1810.2871.44

One test case in innodb.test fails because of auto-increment
changes in r1562:1653:

$diff innodb.result innodb.reject
504c504
< 3	test2		this will work
---
> 4	test2		this will work
2007-07-31 05:56:17 +00:00
marko
c0a0aa1f9c mysql-test/innodb_trx_weight.inc: Add username root to the "connect" statement.
The Unix user running mysql-test-run usually does not have any privileges
on the MySQL test database.
2007-06-06 12:13:59 +00:00
vasil
05cd5bfab5 Fix Bug#21293: Consider transactions that had edited non-transactional
tables heavier than ones that had not. This helps killing the "right"
transaction in case of a deadlock.

Approved by:	Heikki
2007-05-15 14:53:04 +00:00