Commit graph

2125 commits

Author SHA1 Message Date
unknown
98b7766053 Merge stella.local:/home2/mydev/mysql-5.1-amain
into  stella.local:/home2/mydev/mysql-5.1-axmrg


mysql-test/t/query_cache.test:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
mysql-test/r/query_cache.result:
  SCCS merged
2008-03-26 17:36:12 +01:00
unknown
550de36cc5 Merge kpettersson@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  adventure.(none):/home/thek/Development/cpp/mysql-5.1-runtime


sql/sql_acl.cc:
  Auto merged
2008-03-18 13:31:10 +01:00
unknown
001829914b Bug#25175 Too much memory used by MySQL grant system
Each time the server reloads privileges containing table grants, the 
system will allocate too much memory than needed because of badly
chosen growth prediction in the underlying dynamic arrays.

This patch introduces a new signature to the hash container initializer
which enables a much more pessimistic approach in favour for more
efficient memory useage.

This patch was supplied by Google Inc.


include/hash.h:
  * New signature for _hash_init.
  * Defined new function hash_init2 which takes growth_size argument.
mysys/hash.c:
  * New signature for _hash_init.
sql/sql_acl.cc:
  * Changed hash_init signature so that it takes a 'growth_size' smaller
  than the default. Each time a GRANT_TABLE is allocated a pre-allocated
  dynamic array is instantiated. A large growth size can result in too
  many unused hash-entries per table-entry and thus be a waste of free
  memory.
2008-03-18 10:45:36 +01:00
unknown
e79249f81b Manual merge
configure.in:
  Auto merged
mysql-test/r/func_misc.result:
  Auto merged
mysql-test/r/myisam.result:
  Auto merged
mysql-test/r/partition.result:
  Auto merged
mysql-test/r/partition_symlink.result:
  Auto merged
mysql-test/t/func_misc.test:
  Auto merged
mysql-test/t/partition.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/partition_info.cc:
  Auto merged
sql/partition_info.h:
  Auto merged
sql/rpl_rli.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_parse.cc:
  Manual merge. Needs later fix. New code in create table was not
  accepted. Needs to be added to mysql_create_table_no_lock().
2008-03-14 12:02:11 +01:00
unknown
d6df18dd33 Merge kaamos.(none):/data/src/mysql-5.1
into  kaamos.(none):/data/src/opt/mysql-5.1-opt


client/mysql.cc:
  Auto merged
client/mysqldump.c:
  Auto merged
configure.in:
  Auto merged
include/my_global.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
mysql-test/include/mix1.inc:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/func_str.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
storage/ndb/src/kernel/blocks/backup/Backup.hpp:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/r/func_time.result:
  Manual merge.
mysql-test/r/view.result:
  Manual merge.
mysql-test/t/view.test:
  Manual merge.
scripts/mysql_config.sh:
  Manual merge.
sql-common/client.c:
  Manual merge.
sql/sql_parse.cc:
  Manual merge.
2008-03-12 11:19:46 +03:00
unknown
7b5da0aa77 Merge pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/mysql-5.1-engines
into  pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/merge.20080307/mysql-5.1


configure.in:
  Auto merged
include/mysql/plugin.h:
  Auto merged
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/r/partition_innodb.result:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
mysql-test/t/partition_innodb.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/repl_failsafe.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/slave.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_partition.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
storage/myisam/mi_dynrec.c:
  Auto merged
2008-03-07 13:46:29 -08:00
unknown
ce0ab7094e Merge kaamos.(none):/data/src/opt/bug31781/my51
into  kaamos.(none):/data/src/opt/mysql-5.1-opt
2008-03-03 19:49:10 +03:00
unknown
ca753c3a75 Merge kaamos.(none):/data/src/opt/bug31781/my50
into  kaamos.(none):/data/src/opt/bug31781/my51


mysys/my_create.c:
  Auto merged
2008-03-03 17:34:43 +03:00
unknown
162eadbe68 Fix for bug #31781: multi-table UPDATE with temp-pool enabled fails
with errno 17

my_create() did not perform any checks for the case when a file is
successfully created by a call to open(), but the call to
my_register_filename() later fails because the number of open files
has exceeded the my_open_files limit. This can happen on platforms 
which do not have getrlimit(), and hence we do not know the real limit
for open files. In such a case an error was returned to a caller
although the file has actually been created. Since callers assume
my_create() to return an error only when it failed to create a file,
they did not perform any cleanups, leaving an 'orphaned' file on the
file system.

Fixed by adding a check for the above case to my_create() and ensuring
the newly created file is deleted before returning an error.

Creating a deterministic test case in the test suite is impossible,
because the exact steps required to reproduce the above situation
depend on the platform and/or environment (OS per-user limits, queries
executed by previous tests, startup parameters). The patch was
manually tested on Windows using examples posted in the bug report.


mysys/my_create.c:
  Ensure that, if the call to my_register_filename() in my_create()
  failed, but the previous open() called succeeded, the newly created
  file is deleted before returning an error.
2008-03-03 17:34:06 +03:00
unknown
336f2c7e51 Merge quad.:/mnt/raid/alik/MySQL/devel/5.1
into  quad.:/mnt/raid/alik/MySQL/devel/5.1-rt-merged


client/mysqltest.c:
  Auto merged
mysql-test/r/view.result:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_ndbcluster_binlog.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_connect.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/suite/rpl_ndb/t/disabled.def:
  Manually merged.
mysql-test/t/disabled.def:
  Manually merged.
2008-02-26 19:34:02 +03:00
unknown
bf9bb656a6 Bug#34424 query_cache_debug.test leads to valgrind warnings
Bug#34678 @@debug variable's incremental mode

The problem is that the per-thread debugging settings stack wasn't
being deallocated before the thread termination, leaking the stack
memory. The chosen solution is to push a new state if the current
is set to the initial settings and pop it (free) once the thread
finishes.


dbug/dbug.c:
  Move dbug parser out of _db_set_ to a separate function and
  make _db_set_ push a new stack if the corrent one is set to
  the initial settings.
dbug/user.r:
  Update DBUG_SET description.
mysql-test/t/disabled.def:
  Re-enable test case which triggered the leak.
mysys/my_thr_init.c:
  Pop a pushed state, nop if stack is empty.
sql/set_var.cc:
  Handle incremental debug settings.
mysql-test/r/variables_debug.result:
  Add new test case result for Bug#34678
mysql-test/t/variables_debug.test:
  Add new test case for Bug#34678
2008-02-26 12:03:59 -03:00
unknown
205d448b01 fixes for build failures due to my yesterday's changeset forbidding
bool in C.


client/get_password.c:
  fix for build failure
include/thr_alarm.h:
  fix for build failure
libmysql/dll.c:
  fix for build failure
libmysql/get_password.c:
  fix for build failure
mysys/thr_alarm.c:
  fix for build failure
2008-02-19 18:45:11 +01:00
unknown
ae25da10a3 Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-5.1-build
into  gbichot4.local:/home/mysql_src/mysql-5.1-build-gca


client/mysqltest.c:
  Auto merged
include/my_sys.h:
  Auto merged
mysys/thr_lock.c:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
2008-02-18 23:36:57 +01:00
unknown
85213f6235 Fix for server bug experienced in Maria (wrong "Truncated incorrect <var_name>
value" error even though the value was correct): a C function in my_getopt.c
was taking bool* in parameter and was called from C++ sql_plugin.cc,
but on some Mac OS X sizeof(bool) is 1 in C and 4 in C++, giving funny
mismatches. Fixed, all other occurences of bool in C are removed, future
ones are blocked by a "C-bool-catcher" in my_global.h (use my_bool).


client/mysqldump.c:
  my_bool for C
client/mysqltest.c:
  my_bool for C
extra/replace.c:
  my_bool for C
include/my_getopt.h:
  my_bool for C
include/my_global.h:
  Prevent people from using bool in C, it causes real bugs.
include/my_sys.h:
  my_bool for C
include/my_time.h:
  my_bool for C
include/thr_lock.h:
  my_bool for C
libmysql/libmysql.c:
  my_bool for C
mysys/charset.c:
  my_bool for C
mysys/my_getopt.c:
  my_bool for C
mysys/queues.c:
  my_bool for C
mysys/thr_lock.c:
  my_bool for C
regex/reginit.c:
  my_bool for C
sql/set_var.cc:
  C functions use my_bool so we must use my_bool too.
sql/sql_plugin.cc:
  C functions use my_bool so we must use my_bool too.
  This fixes a real observed bug of Maria, because on some Mac OS X,
  sizeof(bool) is 1 in C and 4 in C++, so the bool* does wrong.
  Removing useless line.
storage/heap/hp_update.c:
  my_bool for C
storage/myisam/mi_check.c:
  my_bool for C
storage/myisam/mi_dynrec.c:
  my_bool for C
storage/myisam/mi_search.c:
  my_bool for C
storage/myisam/mi_update.c:
  my_bool for C
storage/myisam/mi_write.c:
  my_bool for C
storage/myisam/myisamdef.h:
  my_bool for C
storage/myisam/myisamlog.c:
  my_bool for C
storage/myisam/myisampack.c:
  my_bool for C
tests/mysql_client_test.c:
  my_bool for C
unittest/mysys/bitmap-t.c:
  my_bool for C
vio/viosslfactories.c:
  my_bool for C
2008-02-18 23:29:39 +01:00
unknown
770b131499 Merge stella.local:/home2/mydev/mysql-5.1-amain
into  stella.local:/home2/mydev/mysql-5.1-axmrg


configure.in:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
2008-02-14 16:53:03 +01:00
unknown
3d5e32b27d Bug#30331 Table_locks_waited shows inaccurate values
The problem is that the Table_locks_waited was incremented only
when the lock request succeed. If a thread waiting for the lock
gets killed or the lock request is aborted, the variable would
not be incremented, leading to inaccurate values in the variable.

The solution is to increment the Table_locks_waited whenever the
lock request is queued. This reflects better the intended behavior
of the variable -- show how many times a lock was waited.


mysql-test/r/lock_multi.result:
  Add test case result for Bug#30331
mysql-test/t/lock_multi.test:
  Add test case for Bug#30331
mysys/thr_lock.c:
  Increment locks_waited whenever the thread is supposed
  to wait for the lock.
2008-01-28 10:52:41 -02:00
unknown
4a113c64ec Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG28884/mysql-5.1-engines
2008-01-24 19:02:28 +04:00
unknown
082cfb8791 BUG#28884 - maybe a problem with malloc into base64.c
Fixed that return value of malloc was not checked.
Fixed wrong argument count (compilation failure) to base64_decode()
function.

Note:
- there is no test case for this fix as this code is never compiled
  into mysql clients/server;
- as this code is used for internal testing purposes only, no changelog
  entry needed.


mysys/base64.c:
  Fixed that return value of malloc was not checked.
  Fixed wrong argument count to base64_decode function.
2008-01-15 16:23:14 +04:00
unknown
adfbe1fb82 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  mysql.com:/misc/mysql/31752_/51-31752_


client/mysql.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
2007-12-17 09:48:30 +01:00
unknown
607941de2e Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/misc/mysql/31752_/50-31752_


client/mysql.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
2007-12-17 09:45:36 +01:00
unknown
ba0506676b Merge mysql.com:/misc/mysql/31752_/50-31752_
into  mysql.com:/misc/mysql/31752_/51-31752_


mysys/mf_pack.c:
  Auto merged
sql/log.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
2007-12-17 09:16:47 +01:00
unknown
02cdb7ecca Merge mysql.com:/misc/mysql/31752_/41-31752_
into  mysql.com:/misc/mysql/31752_/50-31752_


mysys/mf_pack.c:
  Auto merged
sql/log.cc:
  Auto merged
sql/sql_show.cc:
  manual merge
sql/unireg.cc:
  manual merge
2007-12-17 09:13:38 +01: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
33f82b1789 Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt


client/mysql.cc:
  Auto merged
client/mysqltest.c:
  Auto merged
include/mysql_com.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
myisam/mi_check.c:
  Auto merged
mysql-test/r/delayed.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/myisam.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/t/merge.test:
  Auto merged
mysql-test/t/myisam.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/type_datetime.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/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/sql_class.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/r/func_misc.result:
  manual merge
mysql-test/r/innodb_mysql.result:
  manual merge
mysql-test/t/func_misc.test:
  manual merge
mysql-test/t/innodb_mysql.test:
  manual merge
sql/sql_insert.cc:
  manual merge
2007-12-13 14:52:49 +04:00
unknown
1ebb563422 Bug #31177: Server variables can't be set to their current values
fixes for SLES10


mysql-test/r/change_user.result:
  It's unsigned.
mysys/my_getopt.c:
  Failsafe no longer needed, we handle signedness correctly now.
sql/set_var.cc:
  ha_rows can be derived from all kinds of types, but
  they're all unsigned. Display it as such.
tests/mysql_client_test.c:
  cannot easily check this here due to types.
  check with Alik whether we need this on top
  of change_user.test.
2007-12-10 08:12:41 +01:00
unknown
0805384869 Bug#31752: check strmake() bounds
post-fixes: prevent semi-related overflow, additional comments


mysys/mf_pack.c:
  extra comments
sql/log.cc:
  prevent overflow (length parameter of strmake() should
  never become < 0)
sql/sql_show.cc:
  additional comments
sql/unireg.cc:
  additional comments
2007-12-06 11:48:27 +01:00
unknown
bfe58b71f2 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/misc/mysql/31177/50-31177


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/ps_6bdb.result:
  Auto merged
mysql-test/r/ps_7ndb.result:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
2007-12-06 08:46:01 +01:00
unknown
4618d68d6d Bug#31177: Server variables can't be set to their current values
additional fixes for BDB and correct assignment of both signed
and unsigned 64-bit data to unsigned system variables


mysql-test/r/ps_2myisam.result:
  account for UNSIGNED_FLAG
mysql-test/r/ps_3innodb.result:
  account for UNSIGNED_FLAG
mysql-test/r/ps_4heap.result:
  account for UNSIGNED_FLAG
mysql-test/r/ps_5merge.result:
  account for UNSIGNED_FLAG
mysql-test/r/ps_6bdb.result:
  account for UNSIGNED_FLAG
mysql-test/r/ps_7ndb.result:
  account for UNSIGNED_FLAG
mysys/my_getopt.c:
  We have correct signed/unsigned information now, so we no longer
  need to err on the side of caution.
sql/item_func.cc:
  Copy unsigned info over from entry so the item's data
  correctly describe it.
sql/mysqld.cc:
  BDB log buffer size: default can't be less than minimum
sql/set_var.cc:
  Handle signedness of in-values correctly when assigning to
  unsigned types, all the way up to 64-bit. Use handler from
  all three unsigned sysvar types.
sql/set_var.h:
  thd_ulonglong: Override default check with one for unsigned types
2007-12-06 01:28:01 +01:00
unknown
068b6e4222 Merge ramayana.hindu.god:/home/tsmith/m/bk/51
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/51-merge


client/mysqldump.c:
  Auto merged
include/my_base.h:
  Auto merged
include/my_sys.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysql/Makefile.shared:
  Auto merged
mysql-test/lib/mtr_cases.pl:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/grant.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/suite/rpl/t/rpl_ssl.test:
  Auto merged
mysql-test/t/cast.test:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/records.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
storage/myisam/ft_boolean_search.c:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/sort.c:
  Auto merged
mysql-test/t/log_state.test:
  Manual merge fix-up
mysql-test/include/mix1.inc:
  Manual merge
mysql-test/r/ctype_ucs.result:
  Manual merge
mysql-test/r/func_misc.result:
  Manual merge
mysql-test/r/innodb_mysql.result:
  Manual merge
mysql-test/r/key.result:
  Manual merge
mysql-test/r/log_state.result:
  Manual merge
mysql-test/suite/binlog/t/binlog_killed.test:
  Manual merge
mysql-test/t/ctype_ucs.test:
  Manual merge
mysql-test/t/func_misc.test:
  Manual merge
mysql-test/t/key.test:
  Manual merge
sql/item_strfunc.h:
  Manual merge
strings/ctype-simple.c:
  Manual merge
2007-12-05 12:33:36 -07:00
unknown
55a420e134 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/50


client/mysqldump.c:
  Auto merged
include/my_sys.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysql/Makefile.shared:
  Auto merged
myisam/ft_boolean_search.c:
  Auto merged
myisam/sort.c:
  Auto merged
mysql-test/t/cast.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
mysql-test/mysql-test-run.pl:
  Manual merge
mysql-test/r/ctype_ucs.result:
  Manual merge
mysql-test/r/func_misc.result:
  Manual merge
mysql-test/t/binlog_killed.test:
  Manual merge
mysql-test/t/ctype_ucs.test:
  Manual merge
mysql-test/t/func_misc.test:
  Manual merge
sql/item_strfunc.h:
  Manual merge
strings/ctype-simple.c:
  Manual merge
2007-12-04 20:58:21 -07:00
unknown
09bf5b9169 Bug#31177: Server variables can't be set to their current values
additional fixes for 64-bit
---
Merge mysql.com:/misc/mysql/31177/50-31177
into  mysql.com:/misc/mysql/31177/51-31177
---
Bug#31177: Server variables can't be set to their current values

additional 5.1 fixes (for plugins)


mysql-test/t/variables.test:
  replace 32-bit and 64-bit values
  ---
  manual merge
mysys/my_getopt.c:
  'mod' no longer used.
  on 64-bit, limit to (signed) (LONG)LONG_MAX to prevent badness
  in classes using longlong.
sql/sql_plugin.cc:
  handle signedness in plugin-vars so we won't hit an assert()
  in getopt_*_limit_value()
2007-12-04 01:17:52 +01:00
unknown
53f7db282d Bug#31177: Server variables can't be set to their current values
additional fixes for 64-bit


mysql-test/t/variables.test:
  replace 32-bit and 64-bit values
mysys/my_getopt.c:
  'mod' no longer used.
  on 64-bit, limit to (signed) (LONG)LONG_MAX to prevent badness
  in classes using longlong.
2007-12-03 10:01:56 +01:00
unknown
70cb41a240 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  mysql.com:/misc/mysql/31177/51-31177


client/mysql.cc:
  Auto merged
mysql-test/r/index_merge_myisam.result:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/type_bit.result:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
2007-12-02 03:19:07 +01:00
unknown
6a72267d05 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/misc/mysql/31177/50-31177


client/mysql.cc:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/type_bit.result:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/mysqld.cc:
  Auto merged
2007-12-02 01:48:43 +01:00
unknown
58f10e554a Bug#31177: Server variables can't be set to their current values
5.1+ specific fixes (plugins etc.)


include/my_getopt.h:
  make both ull and ll global
mysql-test/r/index_merge_myisam.result:
  we throw warnings to the client, yea, verily
mysql-test/r/innodb.result:
  we throw warnings to the client, yea, verily
mysql-test/r/variables.result:
  we throw warnings to the client, yea, verily
mysql-test/t/variables.test:
  correct result, is multiple of variable's block_size now
mysys/my_getopt.c:
  export getopt_ll_limit_value(), check for integer wrap-around
  in it, same as in ull variant.  Only print warnings to reporter
  when caller didn't ask for diagnostics, otherwise assume caller
  will handle any warnings (id est, throw them client-wards)
sql/mysqld.cc:
  correct signedness of "concurrent-insert"
sql/sql_plugin.cc:
  Throw sys-var out-of-range warnings client-wards for
  plugins, too.
2007-12-01 19:55:06 +01:00
unknown
54ad7d88d0 Merge mysql.com:/misc/mysql/31177/50-31177
into  mysql.com:/misc/mysql/31177/51-31177


include/m_string.h:
  Auto merged
include/my_getopt.h:
  Auto merged
mysql-test/r/delayed.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/key_cache.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/r/type_bit.result:
  Auto merged
mysql-test/r/type_bit_innodb.result:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/mysql_priv.h:
  Auto merged
BitKeeper/deleted/.del-index_merge.result:
  Auto merged
sql/set_var.cc:
  Auto merged
mysql-test/r/variables.result:
  manual merge
client/mysql.cc:
  manual merge
client/mysqltest.c:
  manual merge
mysql-test/r/subselect.result:
  manual merge
mysys/my_getopt.c:
  manual merge
sql/mysqld.cc:
  manual merge
2007-12-01 15:53:56 +01:00
unknown
65b77b9df6 Merge mysql.com:/home/hf/work/31890/my51-31890
into  mysql.com:/home/hf/work/mrg/my51-mrg


mysql-test/r/partition.result:
  SCCS merged
mysql-test/t/partition.test:
  merging
2007-11-30 22:25:03 +04:00
unknown
89a208850a 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.


client/mysql.cc:
  correct maxima in options array
client/mysqltest.c:
  adjust minimum for "sleep" option so default value is no longer
  out of bounds.
include/m_string.h:
  ullstr() - the unsigned brother of llstr()
include/my_getopt.h:
  Flag if we bounded the value (that is, correct anything aside from
  making value a multiple of block-size)
mysql-test/r/delayed.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/index_merge.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/innodb.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/innodb_mysql.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/key_cache.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/packet.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/ps.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/subselect.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/type_bit.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/type_bit_innodb.result:
  We throw a warning now when we adjust out of range parameters.
mysql-test/r/variables.result:
  correct results: bounds and step apply to variables' default values, too
mysql-test/t/variables.test:
  correct results: bounds and step apply to variables' default values, too
mysys/my_getopt.c:
  - apply bounds/step to default values of variables (based on work by serg)
  - print complaints about incorrect values for variables (truncation etc.,
    by requestion of consulting)
  - if no lower maximum is specified in variable definition, bound unsigned
    values at their maximum to prevent wrap-around
  - some calls to error_reporter had a \n, some didn't. remove \n from calls,
    let reporter-function handle it, so the default reporter behaves like that
    in mysqld
sql/mysql_priv.h:
  correct RANGE_ALLOC_BLOCK_SIZE (cleared with monty)
sql/mysqld.cc:
  correct maxima to correct data-type.
  correct minima where higher than default.
  correct range-alloc-block-size.
  correct inno variables so GET_* corresponds to actual variable's type.
sql/set_var.cc:
  When the new value for a variable is out of bounds, we'll send the
  client a warning (but not if the value was simply not a multiple of
  'blocksize').  sys_var_thd_ulong had this, sys_var_long_ptr_global
  didn't; broken out and streamlined to avoid duplication of code.
strings/llstr.c:
  ullstr() - the unsigned brother of llstr()
2007-11-30 06:32:04 +01:00
unknown
c20245d2e7 Merge stella.local:/home2/mydev/mysql-5.1-bug26379-8
into  stella.local:/home2/mydev/mysql-5.1-axmrg
2007-11-25 18:14:55 +01:00
unknown
68321feb17 Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table

Post-pushbuild fix. The merge test failed on Windows.
The MoveFile() function returned the error code
ERROR_ACCESS_DENIED.

The fix is to use a different name for the file to be
deleted. This is the same trick as we use for the error
code ERROR_ALREADY_EXISTS.

Added ERROR_ACCESS_DENIED to the list of error codes that
require to change the name of the file to be deleted.


mysys/my_delete.c:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added ERROR_ACCESS_DENIED to the list of error codes that
  require to change the name of the file to be deleted.
2007-11-22 21:39:28 +01:00
unknown
712d2c47ee Merge stella.local:/home2/mydev/mysql-5.1-amain
into  stella.local:/home2/mydev/mysql-5.1-axmrg


configure.in:
  Auto merged
2007-11-21 20:32:58 +01:00
unknown
b5cd212445 Merge ramayana.hindu.god:/home/tsmith/m/bk/build/50
into  ramayana.hindu.god:/home/tsmith/m/bk/build/51


mysys/default.c:
  Auto merged
2007-11-19 13:40:49 -07:00
unknown
975731aa32 Eliminate 'unused variable' warnings when compiling non-debug build 2007-11-16 14:56:37 -07:00
unknown
c8450b278d Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Bug 26867 - LOCK TABLES + REPAIR + merge table result in
            memory/cpu hogging
Bug 26377 - Deadlock with MERGE and FLUSH TABLE
Bug 25038 - Waiting TRUNCATE
Bug 25700 - merge base tables get corrupted by
            optimize/analyze/repair table
Bug 30275 - Merge tables: flush tables or unlock tables
            causes server to crash
Bug 19627 - temporary merge table locking
Bug 27660 - Falcon: merge table possible
Bug 30273 - merge tables: Can't lock file (errno: 155)

The problems were:

Bug 26379 - Combination of FLUSH TABLE and REPAIR TABLE
                corrupts a MERGE table

  1. A thread trying to lock a MERGE table performs busy waiting while
     REPAIR TABLE or a similar table administration task is ongoing on
     one or more of its MyISAM tables.
  
  2. A thread trying to lock a MERGE table performs busy waiting until all
     threads that did REPAIR TABLE or similar table administration tasks
     on one or more of its MyISAM tables in LOCK TABLES segments do UNLOCK
     TABLES. The difference against problem #1 is that the busy waiting
     takes place *after* the administration task. It is terminated by
     UNLOCK TABLES only.
  
  3. Two FLUSH TABLES within a LOCK TABLES segment can invalidate the
     lock. This does *not* require a MERGE table. The first FLUSH TABLES
     can be replaced by any statement that requires other threads to
     reopen the table. In 5.0 and 5.1 a single FLUSH TABLES can provoke
     the problem.

Bug 26867 - LOCK TABLES + REPAIR + merge table result in
            memory/cpu hogging

  Trying DML on a MERGE table, which has a child locked and
  repaired by another thread, made an infinite loop in the server.

Bug 26377 - Deadlock with MERGE and FLUSH TABLE

  Locking a MERGE table and its children in parent-child order
  and flushing the child deadlocked the server.

Bug 25038 - Waiting TRUNCATE

  Truncating a MERGE child, while the MERGE table was in use,
  let the truncate fail instead of waiting for the table to
  become free.

Bug 25700 - merge base tables get corrupted by
            optimize/analyze/repair table

  Repairing a child of an open MERGE table corrupted the child.
  It was necessary to FLUSH the child first.

Bug 30275 - Merge tables: flush tables or unlock tables
            causes server to crash

  Flushing and optimizing locked MERGE children crashed the server.

Bug 19627 - temporary merge table locking

  Use of a temporary MERGE table with non-temporary children
  could corrupt the children.

  Temporary tables are never locked. So we do now prohibit
  non-temporary chidlren of a temporary MERGE table.

Bug 27660 - Falcon: merge table possible

  It was possible to create a MERGE table with non-MyISAM children.

Bug 30273 - merge tables: Can't lock file (errno: 155)

  This was a Windows-only bug. Table administration statements
  sometimes failed with "Can't lock file (errno: 155)".

These bugs are fixed by a new implementation of MERGE table open.

When opening a MERGE table in open_tables() we do now add the
child tables to the list of tables to be opened by open_tables()
(the "query_list"). The children are not opened in the handler at
this stage.

After opening the parent, open_tables() opens each child from the
now extended query_list. When the last child is opened, we remove
the children from the query_list again and attach the children to
the parent. This behaves similar to the old open. However it does
not open the MyISAM tables directly, but grabs them from the already
open children.

When closing a MERGE table in close_thread_table() we detach the
children only. Closing of the children is done implicitly because
they are in thd->open_tables.

For more detail see the comment at the top of ha_myisammrg.cc.

Changed from open_ltable() to open_and_lock_tables() in all places
that can be relevant for MERGE tables. The latter can handle tables
added to the list on the fly. When open_ltable() was used in a loop
over a list of tables, the list must be temporarily terminated
after every table for open_and_lock_tables().
table_list->required_type is set to FRMTYPE_TABLE to avoid open of
special tables. Handling of derived tables is suppressed.
These details are handled by the new function
open_n_lock_single_table(), which has nearly the same signature as
open_ltable() and can replace it in most cases.

In reopen_tables() some of the tables open by a thread can be
closed and reopened. When a MERGE child is affected, the parent
must be closed and reopened too. Closing of the parent is forced
before the first child is closed. Reopen happens in the order of
thd->open_tables. MERGE parents do not attach their children
automatically at open. This is done after all tables are reopened.
So all children are open when attaching them.

Special lock handling like mysql_lock_abort() or mysql_lock_remove()
needs to be suppressed for MERGE children or forwarded to the parent.
This depends on the situation. In loops over all open tables one
suppresses child lock handling. When a single table is touched,
forwarding is done.

Behavioral changes:
===================

This patch changes the behavior of temporary MERGE tables.
Temporary MERGE must have temporary children.
The old behavior was wrong. A temporary table is not locked. Hence
even non-temporary children were not locked. See
Bug 19627 - temporary merge table locking.

You cannot change the union list of a non-temporary MERGE table
when LOCK TABLES is in effect. The following does *not* work:
CREATE TABLE m1 ... ENGINE=MRG_MYISAM ...;
LOCK TABLES t1 WRITE, t2 WRITE, m1 WRITE;
ALTER TABLE m1 ... UNION=(t1,t2) ...;
However, you can do this with a temporary MERGE table.

You cannot create a MERGE table with CREATE ... SELECT, neither
as a temporary MERGE table, nor as a non-temporary MERGE table.
CREATE TABLE m1 ... ENGINE=MRG_MYISAM ... SELECT ...;
Gives error message: table is not BASE TABLE.


include/my_base.h:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added HA_EXTRA_ATTACH_CHILDREN and HA_EXTRA_DETACH_CHILDREN.
include/myisammrg.h:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added element 'children_attached' to MYRG_INFO.
  Added declarations for myrg_parent_open(),
  myrg_attach_children() and myrg_detach_children()
  for the new MERGE table open approach.
mysql-test/extra/binlog_tests/blackhole.test:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Preliminarily added new error message with a comment.
mysql-test/r/create.result:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Fixed test result.
mysql-test/r/delayed.result:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Moved test result from here to merge.result.
mysql-test/r/merge.result:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Fixed/added test result.
mysql-test/r/myisam.result:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Moved test result for bug 8306 from here to merge.result.
mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Fixed test result.
mysql-test/t/create.test:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Fixed error number.
mysql-test/t/delayed.test:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Moved test from here to merge.test.
mysql-test/t/merge.test:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Fixed test for new temporary MERGE table behavior.
  Exchanged error numbers by symbolic codes.
  Added tests. Included are tests for bugs
  8306 (moved from myisam.test), 26379, 19627, 25038, 25700, 26377,
  26867, 27660, 30275, and 30273.
  Fixed changes resulting from disabled CREATE...SELECT.
  Integrated tests moved from delayed.test and myisam.test to here.
mysql-test/t/myisam.test:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Moved test for bug 8306 from here to merge.test.
mysys/thr_lock.c:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added code to let the owner of a high priority lock (TL_WRITE_ONLY)
  to bypass its own lock.
sql/ha_ndbcluster_binlog.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added 'thd' argument to init_tmp_table_share().
sql/handler.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added 'thd' argument to init_tmp_table_share().
sql/mysql_priv.h:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Removed declaration of check_merge_table_access(). It is now static
  in sql_parse.cc.
  Added declaration for fix_merge_after_open().
  Renamed open_and_lock_tables() to open_and_lock_tables_derived()
  with additional parameter 'derived'.
  Added inline functions simple_open_n_lock_tables() and
  open_and_lock_tables(), which call open_and_lock_tables_derived()
  and add the argument for 'derived'.
  Added new function open_n_lock_single_table(), which can be used
  as an replacement for open_ltable() in most situations. Internally
  it calls simple_open_n_lock_tables() so hat it is appropriate for
  MERGE tables.
  Added 'thd' argument to init_tmp_table_share().
sql/slave.cc:
  ug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added comment.
sql/sql_base.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  
  Defined new functions add_merge_table_list(),
  attach_merge_children(), detach_merge_children(), and
  fix_merge_after_open() for the new MERGE table open approach.
  
  Added calls of the new functions to
  close_handle_and_leave_table_as_lock(), close_thread_tables(),
  close_thread_table(), unlink_open_table(), reopen_name_locked_table(),
  reopen_table(), drop_locked_tables(), close_temporary_table(),
  and open_tables() respectively.
  
  Prevented special lock handling of merge children (like
  mysql_lock_remove, mysql_lock_merge or mysql_lock_abort)
  at many places. Some of these calls are forwarded to the
  parent table instead.
  
  Added code to set thd->some_tables_deleted for every thread that has
  a table open that we are flushing.
  Added code for MERGE tables to unlink_open_table().
  Added MERGE children to the list of unusable tables in open_table().
  Added MERGE table handling to reopen_table().
  Added lock handling and closing of a parent before the children
  in close_data_files_and_morph_locks().
  Added code for re-attaching children in reopen_tables().
  Added MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN to the locking flags and
  error reporting after mysql_lock_tables() in reopen_tables().
  Added lock handling and closing of a parent before the children
  in close_old_data_files().
  Added lock handling and detaching in drop_locked_tables().
  Added code for removing the children list from the statement list
  to prepare for a repetition in open_tables().
  Added new function open_n_lock_single_table(), which can be used
  as an replacement for open_ltable() in most situations. Internally
  it calls simple_open_n_lock_tables() so hat it is appropriate for
  MERGE tables.
  Disabled use of open_ltable() for MERGE tables.
  Removed function simple_open_n_lock_tables(). It is now inline
  declared in mysql_priv.h.
  Renamed open_and_lock_tables() to open_and_lock_tables_derived()
  with additional parameter 'derived'. open_and_lock_tables() is now
  inline declared in mysql_priv.h.
  Added a check for end-of-list in two loops in lock_tables().
  Added 'thd' argument to init_tmp_table_share().
sql/sql_insert.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Changed from open_ltable() to open_n_lock_single_table() in
  handle_delayed_insert().
  Reestablished LEX settings after lex initialization.
  Added 'thd' argument to init_tmp_table_share().
sql/sql_parse.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Made check_merge_table_access() a static function.
  Disabled use of CREATE...SELECT for MERGE tables.
sql/sql_partition.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Fixed comment typo.
sql/sql_select.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added 'thd' argument to init_tmp_table_share().
sql/sql_table.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Optimized use of mysql_ha_flush() in mysql_rm_table_part2().
  Disabled the use of MERGE tables with prepare_for_restore() and
  prepare_for_repair().
  Changed from open_ltable() to open_n_lock_single_table() in
  mysql_alter_table() and mysql_checksum_table().
  Disabled change of child list under LOCK TABLES.
  Initialized table_list->table in mysql_recreate_table().
sql/sql_trigger.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added code for allowing CREATE TRIGGER under LOCK TABLE, to be able
  to test it with MERGE tables.
sql/table.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added 'thd' argument to init_tmp_table_share().
  Setting table_map_id from query_id in init_tmp_table_share().
  Added member function TABLE::is_children_attached().
sql/table.h:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added access method get_table_def_version() to TABLE_SHARE.
  Added elements for MERGE tables to TABLE and TABLE_LIST.
storage/myisam/ha_myisam.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added an unrelated comment to the function comment of table2myisam().
storage/myisam/ha_myisam.h:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added new member function MI_INFO::file_ptr().
storage/myisammrg/ha_myisammrg.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added callback functions to support parent open and children attach
  of MERGE tables.
  Changed ha_myisammrg::open() to initialize storage engine structures
  and create a list of child tables only. Child tables are not opened.
  Added ha_myisammrg::attach_children(), which does now the main part
  of MERGE open.
  Added ha_myisammrg::detach_children().
  Added calls to ::attach_children() and ::detach_children() to
  ::extra() on HA_EXTRA_ATTACH_CHILDREN and HA_EXTRA_DETACH_CHILDREN
  respectively.
  Added a check for matching TEMPORARY type for children against
  parent.
  Added a check for table def version.
  Added support for thd->open_options to attach_children().
  Changed child path name generation for temporary tables so that
  it does nothing special for temporary tables.
storage/myisammrg/ha_myisammrg.h:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added elements to class ha_myisammrg to support the new
  open approach.
  Changed empty destructor definition to a declaration.
  Implemented in ha_myisammrg.cc.
  Added declaration for methods attach_children() and
  detach_children().
  Added definition for method table_ptr() for use with
  callback functions.
storage/myisammrg/myrg_close.c:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added a check to avoid closing of MyISAM tables when the
  child tables are not attached.
  Added freeing of rec_per_key_part when the child tables
  are not attached.
storage/myisammrg/myrg_extra.c:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Some ::extra() functions and ::reset() can be called when
  children are detached.
storage/myisammrg/myrg_open.c:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  
  Kept old myrg_open() for MERGE use independent from MySQL.
  Removed an always true condition in myrg_open().
  Set children_attached for independent MERGE use in myrg_open().
  
  Added myrg_parent_open(), myrg_attach_children(), and
  myrg_detach_children() for the new MERGE table open approach.
mysql-test/r/merge-big.result:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE corrupts a MERGE table
  New test result
mysql-test/t/merge-big.test:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE corrupts a MERGE table
  New test case
2007-11-15 20:25:43 +01:00
unknown
c33c92d0f2 Bug #31890 Partitions: ORDER BY DESC in InnoDB not working.
It's not InnoDB specific bug.
Error is in QUEUE code, about the way we handle queue->max_at_top.
It's either '0' or '-2' and we do '^' operation to get the proper
direction. Though queue->compare() function can return '-2' as
a result of comparison sometimes. So we'll get
queue->compare() ^ queue->max_at_top == 0 (when max_at_top is -2)
and _downheap() function code will go wrong way here:
...
    if (next_index < elements &&
        (queue->compare(queue->first_cmp_arg,
                        queue->root[next_index]+offset_to_key,
                        queue->root[next_index+1]+offset_to_key) ^
         queue->max_at_top) > 0)
      next_index++;
...

Fixed by changing max_at_top to be either 1 or -1, doing
'* max_at_top' to get proper direction.


include/queues.h:
  Bug #31890 Partitions: ORDER BY DESC in InnoDB not working
  
  max_at_top policy changed
mysql-test/r/partition.result:
  Bug #31890 Partitions: ORDER BY DESC in InnoDB not working
  
  test result
mysql-test/t/partition.test:
  Bug #31890 Partitions: ORDER BY DESC in InnoDB not working
  
  test case
mysys/queues.c:
  Bug #31890 Partitions: ORDER BY DESC in InnoDB not working.
  
  queue->max_at_top policy changed - now it can either be '1' or '-1'.
  We multiply comparison result on max_at_top to get the proper
  direction.
2007-11-14 22:20:31 +04:00
unknown
d1d6920db9 Merge trift2.:/MySQL/M51/mysql-5.1
into  trift2.:/MySQL/M51/push-5.1


include/my_sys.h:
  Auto merged
sql/CMakeLists.txt:
  Manual merge: Keep the workaround for the cmake 2.4.6 bug, enclose it in "if".
2007-11-14 16:11:52 +01:00
unknown
e3c7265135 Merge trift2.:/MySQL/M50/mysql-5.0
into  trift2.:/MySQL/M50/push-5.0


include/my_sys.h:
  Auto merged
2007-11-14 15:26:38 +01:00
unknown
e1d98e8d51 Merge mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-5.0-engines
into  mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-5.1-engines


mysql-test/r/symlink.result:
  Auto merged
mysql-test/t/symlink.test:
  Auto merged
mysys/my_symlink2.c:
  Auto merged
2007-11-12 15:26:37 +04:00
unknown
c63fd4dd32 Merge mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-5.0-engines


mysql-test/r/symlink.result:
  Auto merged
mysql-test/t/symlink.test:
  Auto merged
mysys/my_symlink2.c:
  Auto merged
2007-11-12 15:16:00 +04:00
unknown
a1e38552bb Merge mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-4.0
into  mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-4.1-engines


mysys/my_symlink2.c:
  Auto merged
mysql-test/r/symlink.result:
  SCCS merged
mysql-test/t/symlink.test:
  SCCS merged
2007-11-12 15:02:42 +04:00