Commit graph

827 commits

Author SHA1 Message Date
unknown
95a8bb20fb Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


client/client_priv.h:
  Auto merged
client/mysqldump.c:
  Auto merged
include/config-win.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/func_sapdb.result:
  Auto merged
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/r/variables.result:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_timefunc.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
storage/innobase/handler/ha_innodb.cc:
  Auto merged
storage/myisam/sort.c:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/r/query_cache.result:
  manual merge
mysql-test/include/mix1.inc:
  manual merge
mysql-test/r/innodb_mysql.result:
  manual merge
mysql-test/r/type_datetime.result:
  manual merge
mysql-test/r/type_decimal.result:
  manual merge
mysql-test/t/query_cache.test:
  manual merge
mysql-test/t/type_datetime.test:
  manual merge
mysql-test/t/type_decimal.test:
  manual merge
sql/item.cc:
  manual merge
2007-10-23 19:08:21 +05:00
unknown
1241a9da2f The fix for BUG 21136 (ChangeSet@1.2611.1.1) introduced a regression that
caused a few tests to fail because the thd->extra_lock wasn't being set to
NULL after the table was unlocked. This poses a serious problem because later
attempts to access thd->extra_lock (now a dangling pointer) will probably
result in a crash (undefined behavior) -- and that's what actually happens
in some test cases.

The solution is to set the select_create::m_plock pointee to NULL, which
means that thd->extra_lock is set to NULL when the lock data is not for a
temporary table.


sql/sql_insert.cc:
  Set the m_plock pointee to NULL, thus avoiding a dangling thd->extra_lock pointer
  in some cases.
2007-09-29 16:04:31 -03:00
unknown
6e668b4f5b Bug#21136 CREATE TABLE SELECT within CREATE TABLE SELECT causes server crash
When CREATE TEMPORARY TABLE .. SELECT is invoked from a stored function
which in turn is called from CREATE TABLE SELECT causes a memory leak
because the inner create temporary table overrides the outter extra_lock
reference when locking the table.

The solution is to simply not overrride the extra_lock by only using the
extra_lock for a non-temporary table lock.


mysql-test/r/create.result:
  Add test case result for Bug#21136
mysql-test/t/create.test:
  Add test case for Bug#21136
sql/sql_insert.cc:
  For temporary tables, store the lock data within the select_create class
  since tmp tables contents are not replicated. For "real" tables, store
  the lock data in the thread extra_lock pointer.
2007-09-28 18:25:47 -03:00
unknown
2e57478d92 merged the fix for bug 30468 to 5.1-opt
mysql-test/t/grant2.test:
  Auto merged
sql/sql_acl.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
2007-09-27 12:32:59 +03:00
unknown
500d856faf Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B30468-5.0-opt


sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
2007-09-27 12:17:16 +03:00
unknown
66f13d9120 Bug #30468: column level privileges not respected when joining tables
When expanding a * in a USING/NATURAL join the check for table access
for both tables in the join was done using the grant information of the
first one.
Fixed by getting the grant information for the current table while 
iterating through the columns of the join.


mysql-test/r/grant2.result:
  Bug #30468: test case
mysql-test/t/grant2.test:
  Bug #30468: test case
sql/sql_acl.cc:
  Bug #30468: correctly check column grants
sql/sql_acl.h:
  Bug #30468: correctly check column grants
sql/sql_base.cc:
  Bug #30468: correctly check column grants
sql/sql_insert.cc:
  Bug #30468: correctly check column grants
2007-09-27 12:15:19 +03:00
unknown
bc25c6cafb merge of the fix for bug 27802 & 27216 to 5.1-opt
mysql-test/r/view.result:
  merge of the fix for bug 27802 to 5.1
sql/item_cmpfunc.h:
  merge of the fix for bug 27216 to 5.1
sql/sql_insert.cc:
  merge of the fix for bug 27216 to 5.1
sql/sql_lex.h:
  merge of the fix for bug 27802 to 5.1
sql/sql_select.cc:
  merge of the fix for bug 27802 to 5.1
sql/table.h:
  merge of the fix for bug 27802 to 5.1
2007-09-26 19:06:54 +03:00
unknown
e4cbbcf8a9 Merge sunlight.local:/local_work/27216-bug-5.0-opt-mysql
into  sunlight.local:/local_work/merge-5.1-opt-mysql


libmysql/libmysql.c:
  Auto merged
mysql-test/r/date_formats.result:
  Auto merged
mysql-test/r/insert_select.result:
  Auto merged
mysql-test/t/insert_select.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
mysql-test/r/type_datetime.result:
  Manually merged
mysql-test/t/type_datetime.test:
  Manually merged
sql/item_cmpfunc.cc:
  Manually merged
sql/item_cmpfunc.h:
  Manually merged
sql/sql_insert.cc:
  Manually merged
2007-09-24 17:23:40 +04:00
unknown
17df0d648c Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  sunlight.local:/local_work/27216-bug-5.0-opt-mysql


sql/sql_insert.cc:
  Auto merged
2007-09-22 13:10:44 +04:00
unknown
ebaa05efa7 Bug#27216: functions with parameters of different date types may return wrong
type of the result.

There are several functions that accept parameters of different types.
The result field type of such functions was determined based on
the aggregated result type of its arguments. As the DATE and the DATETIME
types are represented by the STRING type, the result field type
of the affected functions was always STRING for DATE/DATETIME arguments.
The affected functions are COALESCE, IF, IFNULL, CASE, LEAST/GREATEST, CASE.

Now the affected functions aggregate the field types of their arguments rather
than their result types and return the result of aggregation as their result
field type.
The cached_field_type member variable is added to the number of classes to
hold the aggregated result field type.
The str_to_date() function's result field type now defaults to the
MYSQL_TYPE_DATETIME.
The agg_field_type() function is added. It aggregates field types with help
of the Field::field_type_merge() function.
The create_table_from_items() function now uses the 
item->tmp_table_field_from_field_type() function to get the proper field
when the item is a function with a STRING result type.


libmysql/libmysql.c:
  Bug#27216: functions with parameters of different date types may return wrong
  type of the result.
  The client library now accepts the NEWDATE type as a string.
sql/item_cmpfunc.cc:
  Bug#27216: functions with parameters of different date types may return wrong
  type of the result.
  Now the fix_length_and_dec functions of the
  Item_func_ifnull,Item_func_if, Item_func_case, Item_func_coalesce
  classes are use agg_field_type function to find out the type of their 
  result field.
sql/item_cmpfunc.h:
  Bug#27216: functions with parameters of different date types may return wrong
  type of the result.
  The cached_field type is added to the Item_func_case, Item_func_if and
  Item_func_coalesce classes.
  The field_type function is added to the Item_func_ifnull, Item_func_if,
  Item_func_coalesce, Item_func_case classes.
sql/item_func.cc:
  Bug#27216: functions with parameters of different date types may return wrong
  type of the result.
  The Item_func_min_max::fix_length_and_dec function now uses the agg_field_type
  function to find out the correct type of the result field.
sql/item_func.h:
  Bug#27216: functions with parameters of different date types may return wrong
  type of the result.
  The cached_field_type variable is added to the Item_func_min_max class.
sql/item_timefunc.cc:
  Bug#27216: functions with parameters of different date types may return wrong
  type of the result.
  The result of the str_to_date function now defaults to the
  DATETIME type.
sql/mysql_priv.h:
  Bug#27216: functions with parameters of different date types may return wrong
  type of the result.
  The prototype of the agg_field_type function is added.
sql/protocol.cc:
  Bug#27216: functions with parameters of different date types may return wrong
  type of the result.
  The Protocol_simple::store function is now used to store fields of NEWDATE type.
sql/sql_insert.cc:
  Bug#27216: functions with parameters of different date types may return wrong
  type of the result.
  The create_table_from_items function now uses the
  tmp_table_field_from_field_type function to get field for items with the
  STRING result type.
mysql-test/r/date_formats.result:
  A test case result corrected after fixing bug#27216.
mysql-test/r/type_datetime.result:
  Added a test case for the bug#27216: functions with parameters of different
  date types may return wrong type of the result.
mysql-test/t/type_datetime.test:
  Added a test case for the bug#27216: functions with parameters of different
  date types may return wrong type of the result.
2007-09-22 11:49:27 +04:00
unknown
f7f1095908 Bug#30384: Having SQL_BUFFER_RESULT option in the CREATE .. KEY(..) .. SELECT
led to creating corrupted index.

While execution of the  CREATE .. SELECT SQL_BUFFER_RESULT statement the 
engine->start_bulk_insert function was called twice. On the first call
On the first call MyISAM disabled all non-unique indexes and on the second
call it decides to not re-enable them because all indexes was disabled.
Due to this no indexes was actually created during CREATE TABLE thus
producing crashed table.

Now the select_inset class has is_bulk_insert_mode flag which prevents
calling the start_bulk_insert function twice.
The flag is set in the select_create::prepare, select_insert::prepare2
functions and the select_insert class constructor.
The flag is reset in the select_insert::send_eof function.


mysql-test/t/insert_select.test:
  A test case is added for the bug#30384: Having SQL_BUFFER_RESULT option in the
  CREATE .. KEY(..) .. SELECT led to creating corrupted index.
mysql-test/r/insert_select.result:
  A test case is added for the bug#30384: Having SQL_BUFFER_RESULT option in the 
  CREATE .. KEY(..) .. SELECT led to creating corrupted index.
sql/sql_class.h:
  Bug#30384: Having SQL_BUFFER_RESULT option in the CREATE .. KEY(..) .. SELECT
  led to creating corrupted index.
  The is_bulk_insert_mode flag is added to the select_insert class.
sql/sql_insert.cc:
  Bug#30384: Having SQL_BUFFER_RESULT option in the CREATE .. KEY(..) .. SELECT
  led to creating corrupted index.
  The is_bulk_insert_mode is set in the select_create::prepare, select_insert::prepare2
  functions and the select_insert class constructor.
  The flag is reset in the select_insert::send_eof function.
2007-09-21 12:09:00 +04:00
unknown
5a437ae911 Merge adventure.(none):/home/thek/Development/cpp/bug27358/my51-bug27358
into  adventure.(none):/home/thek/Development/cpp/mysql-5.1-runtime


sql/sql_insert.cc:
  Auto merged
2007-09-10 11:42:16 +02:00
unknown
22436c86e0 Merge adventure.(none):/home/thek/Development/cpp/bug27358/my50-bug27358
into  adventure.(none):/home/thek/Development/cpp/bug27358/my51-bug27358


mysql-test/r/delayed.result:
  Auto merged
mysql-test/t/delayed.test:
  Auto merged
sql/sql_insert.cc:
  SCCS merged
2007-09-10 11:38:23 +02:00
unknown
0458c3cfc8 Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-rt50-merge


sql/sql_insert.cc:
  Auto merged
2007-08-30 17:05:49 -06:00
unknown
041be8f029 Merge moksha.local:/Users/davi/mysql/push/bugs/28587-5.0
into  moksha.local:/Users/davi/mysql/push/bugs/28587-5.1


sql/sql_insert.cc:
  Auto merged
2007-08-30 16:13:07 -03:00
unknown
bccbd5c493 Bug#28587 SELECT is blocked by INSERT waiting on read lock, even with low_priority_updates
The problem is that a SELECT on one thread is blocked by INSERT ... ON
DUPLICATE KEY UPDATE on another thread even when low_priority_updates is
activated.

The solution is to possibly downgrade the lock type to the setting of
low_priority_updates if the INSERT cannot be concurrent.


sql/sql_insert.cc:
  Possibly downgrade lock type to the the setting of low_priority_updates if
  if the INSERT cannot be concurrent.
2007-08-30 16:11:53 -03:00
unknown
44d04c81ac Bug#27358 INSERT DELAYED does not honour SQL_MODE of the client
SQL_MODE was ignored when a client issued INSERT DELAYED.

Some system settings weren't copied as intended when a record was saved for
a delayed insert. 


mysql-test/r/delayed.result:
  Added test case
mysql-test/t/delayed.test:
  Added test case
sql/sql_insert.cc:
  - Added two new variables (sql_mode, auto_increment_field_not_null) to support
    SQL_MODE in INSERT DELAYED statements.
2007-08-23 10:22:20 +02:00
unknown
c5f0611fad Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/my/mysql-5.1


configure.in:
  Auto merged
client/mysql.cc:
  Auto merged
include/m_ctype.h:
  Auto merged
sql/field.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/log.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/sp_head.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.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/mi_rkey.c:
  Auto merged
client/mysqldump.c:
  Manual merge (trivial)
scripts/mysql_install_db.sh:
  Complex merge (parital rewrite of new code)
sql/sql_show.cc:
  Manual merge
tests/mysql_client_test.c:
  then
    if ! test -x "$print_defaults"
    then
      missing_in_basedir my_print_defaults
      exit 1
    fi
  else
2007-08-14 00:22:34 +03:00
unknown
09a53f28a7 Fixed a lot of compiler warnings and errors detected by Forte C++ on Solaris
Faster thr_alarm()
Added 'Opened_files' status variable to track calls to my_open()
Don't give warnings when running mysql_install_db
Added option --source-install to mysql_install_db

I had to do the following renames() as used polymorphism didn't work with Forte compiler on 64 bit systems
index_read()      -> index_read_map()
index_read_idx()  -> index_read_idx_map()
index_read_last() -> index_read_last_map()


BUILD/compile-solaris-sparc-forte:
  Updated script to current Solaris installations
  Now we compile by default for 64 bits
client/mysql.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
client/mysql_upgrade.c:
  Fixed compiler warning (on Forte)
client/mysqladmin.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
client/mysqlcheck.c:
  Fixed compiler warning (on Forte)
client/mysqldump.c:
  Fixed compiler warning (on Forte)
client/mysqlslap.c:
  Fixed compiler warning (on Forte)
client/mysqltest.c:
  Fixed compiler warning (on Forte)
client/sql_string.cc:
  Avoid compiler warnings when using C function pointers in C++
configure.in:
  Added detection of mtmalloc and ieeefp.h
extra/replace.c:
  Fixed compiler warning (on Forte)
include/m_ctype.h:
  Added some typedef's to make it easy to use C function pointers in C++
include/my_sys.h:
  Added my_file_total_opened (counter for calls to my_open())
include/myisam.h:
  Fixed compiler warning (on Forte)
libmysql/libmysql.c:
  Fixed compiler warning (on Forte) by adding casts and change types
libmysql/manager.c:
  Fixed compiler warning (on Forte) by adding casts and change types
mysql-test/r/ctype_cp932_binlog_stm.result:
  Updated positions
  (Needed because we didn't before correctly restore collation_database after running stored procedure
mysys/my_fopen.c:
  Count number of opened files
mysys/my_open.c:
  Count number of opened files
mysys/my_static.c:
  Count number of opened files
mysys/thr_alarm.c:
  Optimization to do less alarm() and pthread_sigmask() calls.
  Idea is to remember time for next pending alarm and not reschedule a new alarm if it's after the current one.
  Before we only did this if there was other pending alarms.
  We don't have to use pthread_sigmask() in case of 'USE_ONE_SIGNAL_HAND' as the alarm()
  signal will be blocked for the calling thread anyway and no other thread will have the alarm() signal enabled to call process_alarm()
regex/regcomp.c:
  Fixed compiler warning (on Forte) by adding casts and change types
scripts/mysql_install_db.sh:
  Added option --source-install to allow one to create a mysql database from the source tree without installing MySQL
  Don't give (unnecessary) warnings
server-tools/instance-manager/angel.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
server-tools/instance-manager/thread_registry.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/event_db_repository.cc:
  index_read() -> index_read_map()
sql/event_queue.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/field.cc:
  Fixed compiler warnings about hidden fields
sql/ha_partition.cc:
  Fixed compiler warnings about hidden fields
  index_read() -> index_read_map()
sql/ha_partition.h:
  index_read() -> index_read_map()
sql/handler.cc:
  Added PAGE option to row types (to prepare for future)
  index_read() -> index_read_map()
sql/handler.h:
  Added ROW_TYPE_PAGE (for future)
  Added flag to signal if table was to be created transactionally
  I had to do the following renames() as used polymorphism didn't work with Forte compiler on 64 bit systems
  index_read()      -> index_read_map()
  index_read_idx()  -> index_read_idx_map()
  index_read_last() -> index_read_last_map()
sql/item.cc:
  Fixed indentation
  Renamed local variable to avoid hiding class variable
sql/item_cmpfunc.cc:
  Renamed local variable to avoid hiding class variable
sql/item_cmpfunc.h:
  Removed not used variable
sql/item_func.cc:
  Renamed local variable to avoid hiding class variable
sql/item_strfunc.cc:
  Moved functions from Item_strfunc.cc
sql/item_strfunc.h:
  Move functions to item_strfunc.cc
  Use C function pointer type to avoid compiler warnings (with Forte)
sql/item_subselect.cc:
  index_read() -> index_read_map()
sql/item_xmlfunc.cc:
  Renamed local variable to avoid hiding class variable
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/key.cc:
  Fixed indentation
sql/log.cc:
  Renamed local variable to avoid hiding class variable
sql/log_event.cc:
  Removed call to my_time() when creating class instance of Log_event() as this may have static instances.
  (One can't call my_time() before my_init())
  index_read() -> index_read_map()
  Renamed local variable to avoid hiding class variable
sql/log_event_old.cc:
  Renamed local variable to avoid hiding class variable
sql/mysql_priv.h:
  Made all create_backup_ctx() declarations identical.
  This lifted up a bug where wrong create_backup_ctx() was called in some cases.
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/mysqld.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
  Fixed indentation
  Don't call end_thr_alarm() when calling unireg_abort() as unireg_abort() already calls end_thr_alarm()
  Added variable 'Opened_files' (number of calls to my_open() or my_fopen())
  Don't print 'loose' warnings when using --bootstrap (to avoid warnings when running mysql_install_db)
  Fixed compiler warnings
sql/opt_range.cc:
  index_read() -> index_read_map()
sql/opt_sum.cc:
  index_read() -> index_read_map()
sql/partition_info.cc:
  Renamed local variable to avoid hiding class variable
sql/rpl_filter.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/set_var.cc:
  Renamed local variable to avoid hiding class variable
  Added 'process_key_cache_t' type to avoid compiler warning (on Forte)
sql/set_var.h:
  Added 'process_key_cache_t' type to avoid compiler warning (on Forte)
sql/sp.cc:
  More debugging
  index_read() -> index_read_map()
sql/sp_cache.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/sp_head.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
  Moved 'saved_creation_ctx' higher up to be able to free objects allocated by create_backup_ctx()
sql/sql_acl.cc:
  index_read() -> index_read_map()
sql/sql_class.cc:
  Renamed local variable to avoid hiding class variable
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/sql_class.h:
  Renamed local variable to avoid hiding class variable
sql/sql_db.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/sql_delete.cc:
  Renamed local variable to avoid hiding class variable
sql/sql_handler.cc:
  index_read() -> index_read_map()
sql/sql_help.cc:
  index_read() -> index_read_map()
sql/sql_insert.cc:
  index_read() -> index_read_map()
  Renamed local variable to avoid hiding class variable
sql/sql_lex.cc:
  Renamed local variable to avoid hiding class variable
sql/sql_plugin.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
  index_read() -> index_read_map()
  Don't give warnings about not used plugins if we are using --warnings=0
sql/sql_select.cc:
  index_read() -> index_read_map()
sql-common/client.c:
  Fixed compiler warning (on Forte)
sql-common/my_time.c:
  Removed never accessed code
  Fixed compiler warning (on Forte)
sql/sql_servers.cc:
  index_read() -> index_read_map()
sql/sql_show.cc:
  Added TRANSACTIONAL to SHOW CREATE
  Fixed ROW_TYPE_PAGE
sql/sql_string.cc:
  Avoid compiler warnings when using C function pointers in C++
sql/sql_table.cc:
  Set create_info->transactional if we used TRANSACTIONAL=1
sql/sql_udf.cc:
  index_read() -> index_read_map()
sql/sql_yacc.yy:
  Added TRANSACTIONAL=0|1 to CREATE (for future)
  Added row type PAGE (was only partionally handled before)
sql/strfunc.cc:
  Avoid compiler warnings when using C function pointers in C++
sql/table.cc:
  More DBUG statements
  Declare all create_backup_ctx() functions identically
  Remember if table was created with TRANSACTIONAL flag or not (future safe)
  Renamed local variable to avoid hiding class variable
sql/table.h:
  Remember if table was created with TRANSACTIONAL=1
sql/tztime.cc:
  index_read() -> index_read_map()
sql-common/pack.c:
  Fixed compiler warning (on Forte)
storage/archive/archive_reader.c:
  Fixed compiler warning (on Forte)
storage/archive/azio.c:
  Fixed compiler warning (on Forte)
storage/blackhole/ha_blackhole.cc:
  index_read() -> index_read_map()
storage/blackhole/ha_blackhole.h:
  index_read() -> index_read_map()
storage/csv/ha_tina.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
storage/example/ha_example.cc:
  index_read() -> index_read_map()
storage/example/ha_example.h:
  index_read() -> index_read_map()
storage/heap/ha_heap.cc:
  index_read() -> index_read_map()
storage/heap/ha_heap.h:
  index_read() -> index_read_map()
storage/heap/hp_test1.c:
  Fixed compiler warning (on Forte)
storage/heap/hp_test2.c:
  Fixed compiler warning (on Forte)
storage/myisam/ft_boolean_search.c:
  Fixed compiler warning (on Forte)
storage/myisam/ft_nlq_search.c:
  Fixed compiler warning (on Forte)
storage/myisam/ft_parser.c:
  Fixed compiler warning (on Forte)
storage/myisam/ft_stopwords.c:
  Fixed compiler warning (on Forte)
storage/myisam/ha_myisam.cc:
  index_read() -> index_read_map()
storage/myisam/ha_myisam.h:
  index_read() -> index_read_map()
storage/myisam/mi_check.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_delete.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_dynrec.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_extra.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_key.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_keycache.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_locking.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_log.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_open.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_packrec.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_page.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_rkey.c:
  Added comment
storage/myisam/mi_search.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_statrec.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_test1.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_test2.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_test3.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_update.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_write.c:
  Fixed compiler warning (on Forte)
storage/myisam/myisamdef.h:
  Fixed that file_read/file_write returns type size_t
  Changed some functions to use uchar * as argument/return value instead of char*
  This fixed some compiler warnings on Forte
storage/myisam/myisamlog.c:
  Fixed compiler warning (on Forte)
storage/myisam/myisampack.c:
  Fixed compiler warning (on Forte)
storage/myisam/rt_test.c:
  Fixed compiler warning (on Forte)
storage/myisam/sort.c:
  Fixed compiler warning (on Forte) by adding casts or changing variables to uchar*
storage/myisam/sp_test.c:
  Fixed compiler warning (on Forte) by adding casts or changing variables to uchar*
storage/myisammrg/ha_myisammrg.cc:
  index_read() -> index_read_map()
storage/myisammrg/ha_myisammrg.h:
  index_read() -> index_read_map()
storage/myisammrg/myrg_create.c:
  Fixed compiler warning (on Forte) by adding casts or changing variable types
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp:
  Tdummy -> align  (as in other part of cluster code)
storage/ndb/src/kernel/vm/DynArr256.cpp:
  Removed not used variable
storage/ndb/src/ndbapi/Ndb.cpp:
  Removed not used variable
strings/strtod.c:
  Include ieeefp.h to avoid compiler warning
tests/bug25714.c:
  Fixed compiler warning
tests/mysql_client_test.c:
  Remove not used variable
  Fixed indentation
  Removed never reached code
  Fixed compiler warning (on Forte) by adding casts or changing variable types
vio/viosocket.c:
  Fixed compiler warning (on Forte) by adding casts or changing variable types
2007-08-13 16:11:25 +03:00
unknown
d63ec0931d Merge bk-internal:/home/bk/mysql-5.1-marvel
into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build-marvel-engines


BitKeeper/etc/ignore:
  auto-union
configure.in:
  Auto merged
BitKeeper/deleted/.del-CMakeLists.txt~99a50df6:
  Auto merged
client/mysqlbinlog.cc:
  Auto merged
client/mysqldump.c:
  Auto merged
include/mysql.h:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/ha_ndbcluster_binlog.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/log.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_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/sql_parse.cc:
  merge fix
sql/sql_select.cc:
  merge fix
2007-08-03 17:15:23 +02:00
unknown
705e7a748e Merge bk-internal:/home/bk/mysql-5.1-engines
into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build-marvel-engines


sql/sql_insert.cc:
  Auto merged
2007-08-03 16:53:06 +02:00
unknown
09d74da734 Merge chilla.local:/home/mydev/mysql-5.0-amain
into  chilla.local:/home/mydev/mysql-5.0-axmrg


sql/sql_insert.cc:
  Auto merged
2007-08-03 06:56:04 +02:00
unknown
fc14090bb2 Merge mysql.com:/home/svoj/devel/mysql/BUG29152/mysql-5.0-engines
into  mysql.com:/home/svoj/devel/mysql/BUG29152/mysql-5.1-engines


sql/sql_insert.cc:
  Auto merged
2007-08-02 19:08:39 +05:00
unknown
926664fe2c Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/my/mysql-5.1


client/client_priv.h:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqlslap.c:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
sql/event_data_objects.cc:
  Auto merged
sql/event_queue.cc:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/log.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql-common/client.c:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_cache.cc:
  Manual merge
  Removed comment about bug in old code (not relevant)
2007-08-02 07:55:33 +03:00
unknown
15835a5693 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/51


mysql-test/r/show_check.result:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/show_check.test:
  Auto merged
sql/handler.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/log.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
2007-08-01 18:40:02 -06:00
unknown
8018d6ac94 BUG#29152 - INSERT DELAYED does not use concurrent_insert on slave
INSERT DELAYED on a replication slave was converted to regular INSERT,
whereas it should try concurrent INSERT first.

With this patch we try to convert delayed insert to concurrent insert on
a replication slave. If it is impossible for some reason, we fall back to
regular insert.

No test case for this fix. I do not see anything indicating this is
regression - we behave this way since Nov 2000.


sql/sql_insert.cc:
  If we're executing INSERT DELAYED on a replication slave, we're upgrading
  lock type to TL_WRITE as we need to ensure serial execution of queries on
  the slave.
  
  OTOH if we're executing regular INSERT on a replication slave, we're
  trying TL_WRITE_CONCURRENT_INSERT first, and if we may not use it, we
  fall back to TL_WRITE.
  
  Fixed INSERT DELAYED on a replication slave to behave the same way as
  regular INSERT, that is to try TL_WRITE_CONCURRENT_INSERT first.
2007-07-31 19:40:36 +05:00
unknown
8e1ec7ab5e merge of the fix for bug 17417 5.0-opt->5.1-opt 2007-07-31 14:58:04 +03:00
unknown
e5fd6b3c71 (Pushing for Andrei)
Merge magare.gmz:/home/kgeorge/mysql/work/B27417-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B27417-5.1-opt


mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_table.cc:
  Auto merged
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
  merge of bug 27471 from 5.0-opt to 5.1-opt
sql/log.cc:
  merge of bug 27471 from 5.0-opt to 5.1-opt
sql/set_var.cc:
  merge of bug 27471 from 5.0-opt to 5.1-opt
sql/sp_head.cc:
  merge of bug 27471 from 5.0-opt to 5.1-opt
sql/sql_delete.cc:
  merge of bug 27471 from 5.0-opt to 5.1-opt
sql/sql_insert.cc:
  merge of bug 27471 from 5.0-opt to 5.1-opt
sql/sql_load.cc:
  merge of bug 27471 from 5.0-opt to 5.1-opt
sql/sql_parse.cc:
  merge of bug 27471 from 5.0-opt to 5.1-opt
sql/sql_update.cc:
  merge of bug 27471 from 5.0-opt to 5.1-opt
2007-07-30 19:02:21 +03:00
unknown
1307d3b803 (pushing for Andrei)
Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack
  
Once had been set the flag might later got reset inside of a stored routine 
execution stack.
The reason was in that there was no check if a new statement started at time 
of resetting.
The artifact affects most of binlogable DML queries. Notice, that multi-update 
is wrapped up within
  bug@27716 fix, multi-delete bug@29136.
  
Fixed with saving parent's statement flag of whether the statement modified 
non-transactional table, and unioning (merging) the value with that was gained 
in mysql_execute_command.
  
Resettling thd->no_trans_update members into thd->transaction.`member`;
Asserting code;
Effectively the following properties are held.
  
1. At the end of a substatement thd->transaction.stmt.modified_non_trans_table
   reflects the fact if such a table got modified by the substatement.
   That also respects THD::really_abort_on_warnin() requirements.
2. Eventually thd->transaction.stmt.modified_non_trans_table will be computed as
   the union of the values of all invoked sub-statements.
   That fixes this bug#27417;

Computing of thd->transaction.all.modified_non_trans_table is refined to base to 
the stmt's value for all the case including insert .. select statement which 
before the patch had an extra issue bug@28960.
Minor issues are covered with mysql_load, mysql_delete, and binloggin of insert in
to temp_table select. 
  
The supplied test verifies limitely, mostly asserts. The ultimate testing is defered
for bug@13270, bug@23333.


mysql-test/r/mix_innodb_myisam_binlog.result:
  results changed
mysql-test/t/mix_innodb_myisam_binlog.test:
  regression test incl the related bug#28960.
sql/ha_ndbcluster.cc:
  thd->transaction.{all,stmt}.modified_non_trans_table
  instead of
  thd->no_trans_update.{all,stmt}
sql/handler.cc:
  thd->transaction.{all,stmt}.modified_non_trans_table
  instead of
  thd->no_trans_update.{all,stmt}
sql/handler.h:
  new member added
sql/log.cc:
  thd->transaction.{all,stmt}.modified_non_trans_table
  instead of
  thd->no_trans_update.{all,stmt}
sql/set_var.cc:
  thd->transaction.{all,stmt}.modified_non_trans_table
  instead of
  thd->no_trans_update.{all,stmt}
sql/sp_head.cc:
  thd->transaction.{all,stmt}.modified_non_trans_table
  instead of
  thd->no_trans_update.{all,stmt}
  
  and saving and merging stmt's flag at the end of a substatement.
sql/sql_class.cc:
  thd->transaction.{all,stmt}.modified_non_trans_table
  instead of
  thd->no_trans_update.{all,stmt}
sql/sql_class.h:
  thd->transaction.{all,stmt}.modified_non_trans_table
  instead of
  thd->no_trans_update.{all,stmt}
sql/sql_delete.cc:
  correcting basic delete incl truncate branch and multi-delete queries to set
  stmt.modified_non_trans_table;
  optimization to set the flag at the end of per-row loop;
  multi-delete still has an extra issue similar to bug#27716 of multi-update 
  - to be address with bug_29136 fix.
sql/sql_insert.cc:
  thd->transaction.{all,stmt}.modified_non_trans_table
  instead of
  thd->no_trans_update.{all,stmt}
sql/sql_load.cc:
  eliminating a separate issue where the stmt flag was saved and re-stored after 
  write_record that actually could change it and the change would be lost but 
  should remain permanent;
  thd->transaction.{all,stmt}.modified_non_trans_table
  instead of
  thd->no_trans_update.{all,stmt}
sql/sql_parse.cc:
  initialization to transaction.stmt.modified_non_trans_table at the common part 
  of all types of statements processing - mysql_execute_command().
sql/sql_table.cc:
  moving the reset up to the mysql_execute_command() caller
sql/sql_update.cc:
  correcting update query case (multi-update part of the issues covered by other 
  bug#27716 fix)
  thd->transaction.{all,stmt}.modified_non_trans_table
  instead of
  thd->no_trans_update.{all,stmt}
2007-07-30 18:27:36 +03:00
unknown
b59217ebbb Slow query log to file now displays queries with microsecond precission
--long-query-time is now given in seconds with microseconds as decimals
--min_examined_row_limit added for slow query log
long_query_time user variable is now double with 6 decimals
Added functions to get time in microseconds
Added faster time() functions for system that has gethrtime()  (Solaris)
We now do less time() calls.
Added field->in_read_set() and field->in_write_set() for easier field manipulation by handlers
set_var.cc and my_getopt() can now handle DOUBLE variables.
All time() calls changed to my_time()
my_time() now does retry's if time() call fails.
Added debug function for stopping in mysql_admin_table() when tables are locked
Some trivial function and struct variable renames to avoid merge errors.
Fixed compiler warnings
Initialization of some time variables on windows moved to my_init() 


include/my_getopt.h:
  Added support for double arguments
include/my_sys.h:
  Fixed wrong type to packfrm()
  Added new my_time functions
include/mysql/plugin.h:
  Added support for DOUBLE
libmysql/CMakeLists.txt:
  Added new time functions
libmysql/Makefile.shared:
  Added new time functions
mysql-test/r/variables.result:
  Testing of long_query_time
mysql-test/t/variables.test:
  Testing of long_query_time
mysys/charset.c:
  Fixed compiler warnings
mysys/default_modify.c:
  Fixed compiler warnings
mysys/hash.c:
  Fixed compiler warnings
mysys/mf_getdate.c:
  Use my_time()
mysys/mf_iocache2.c:
  Fixed compiler warnings
mysys/mf_pack.c:
  Fixed compiler warnings
mysys/mf_path.c:
  Fixed compiler warnings
mysys/my_append.c:
  Fixed compiler warnings
mysys/my_compress.c:
  Fixed compiler warnings
mysys/my_copy.c:
  Fixed compiler warnings
mysys/my_gethwaddr.c:
  Fixed compiler warnings
mysys/my_getopt.c:
  Added support for double arguments
mysys/my_getsystime.c:
  Added functions to get time in microseconds.
  Added faster time() functions for system that has gethrtime()  (Solaris)
  Moved windows initialization code to my_init()
mysys/my_init.c:
  Added initializing of variables needed for windows time functions
mysys/my_static.c:
  Added variables needed for windows time functions
mysys/my_static.h:
  Added variables needed for windows time functions
mysys/my_thr_init.c:
  Added THR_LOCK_time, used for faster my_time()
mysys/mysys_priv.h:
  Added THR_LOCK_time, used for faster my_time()
mysys/thr_alarm.c:
  time() -> my_time()
sql/event_data_objects.cc:
  end_time() -> set_current_time()
sql/event_queue.cc:
  end_time() -> set_current_time()
sql/event_scheduler.cc:
  Fixed compiler warnings
sql/field.h:
  Added field->in_read_set() and field->in_write_set() for easier field manipulation by handlers
sql/item.h:
  Added decimal to Item_float(double)
sql/item_cmpfunc.h:
  Added decimal to Item_float(double)
sql/item_timefunc.cc:
  time() -> my_time()
sql/item_xmlfunc.cc:
  Fixed compiler warning
sql/lock.cc:
  lock_time() -> set_time_after_lock()
sql/log.cc:
  Timing in slow query log to file is now done in microseconds
  Changed some while() loops to for() loops.
  Fixed indentation
  time() -> my_time()
sql/log.h:
  Slow query logging is now done based on microseconds
sql/log_event.cc:
  time() -> my_time()
  Fixed arguments to new Item_float()
sql/mysql_priv.h:
  Fixed compiler warnings
  Added opt_log_slow_slave_statements
sql/mysqld.cc:
  Added --log_slow_slave_statements and --min_examined_row_limit
  --long-query-time now takes a double argument with microsecond resolution
  Don't write shutdown message when using --help
  Removed not needed \n
  Thread create time and connect time is now done in microseconds
  time() -> my_time()
  Avoid some time() calls
sql/net_serv.cc:
  Fixed compiler warnings
sql/parse_file.cc:
  time() -> my_time()
sql/set_var.cc:
  Added support for DOUBLE variables
  Added support for variables that are given in seconds with microsecond resolution
sql/set_var.h:
  Added support for variables that are given in seconds with microsecond resolution
sql/slave.cc:
  Allow logging of slave queries to slow query log if 'opt_log_slow_slave_statements' is given
  time() -> my_time()
sql/sql_cache.h:
  Fixed compiler warning()
sql/sql_class.cc:
  Initialize new THD variables
sql/sql_class.h:
  long_query_time is now in microseconds
  Added min_examined_row_limit
  Reordered some THD elements for higher efficency
  Added timers in microseconds (connect_utime, thr_create_utime, start_utime and utime_after_lock)
  Start of query is now recorded both in seconds and in microseconds.
  Following renames was made for more clarity and avoid merge problems from earlier versions:
  connect_time -> connect_utime
  thr_create_time -> thr_create_utime
  end_time()  -> set_current_time()
  lock_time() -> set_time_after_lock()
  
  Added THD::start_utime, which is start of query in microseconds from some arbitary time
  Added function THD::current_utime()
  
  Removed safe_time() as retry's are handled in my_time()
sql/sql_connect.cc:
  User resources are now using microsecond resolution
sql/sql_insert.cc:
  end_time() -> set_current_time()
sql-common/client.c:
  time() -> my_time()
sql/sql_parse.cc:
  Testing if we should print to slow_query_log() is now done with microsecond precission.
  If min_examined_row_limit is given, only log queries to slow query log that has examined more rows than this.
sql/sql_select.cc:
  Simplify code now that Item_float() takes decimals as argument
sql/sql_show.cc:
  time() -> my_time()
  Added support for SYS_DOUBLE
sql/sql_table.cc:
  Added debug function for stopping in mysql_admin_table() when tables are locked
sql/structs.h:
  intime -> reset_utime
2007-07-30 11:33:50 +03:00
unknown
30408a12d8 Merge gleb.loc:/home/uchum/work/bk/5.0-opt
into  gleb.loc:/home/uchum/work/bk/5.1-opt


sql/sql_insert.cc:
  Auto merged
BitKeeper/deleted/.del-bdb.result:
  Auto merged
BitKeeper/deleted/.del-ha_berkeley.cc:
  Auto merged
BitKeeper/deleted/.del-rpl_insert_delayed.result:
  Auto merged
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
  Auto merged
sql/sql_select.cc:
  Merge with 5.0-opt.
sql/table.cc:
  Merge with 5.0-opt.
2007-07-27 13:38:11 +05:00
unknown
4462578a1c WL#3984 (Revise locking of mysql.general_log and mysql.slow_log)
Bug#25422 (Hang with log tables)
Bug 17876 (Truncating mysql.slow_log in a SP after using cursor locks the
          thread)
Bug 23044 (Warnings on flush of a log table)
Bug 29129 (Resetting general_log while the GLOBAL READ LOCK is set causes
           a deadlock)

Prior to this fix, the server would hang when performing concurrent
ALTER TABLE or TRUNCATE TABLE statements against the LOG TABLES,
which are mysql.general_log and mysql.slow_log.

The root cause traces to the following code:
in sql_base.cc, open_table()
  if (table->in_use != thd)
  {
    /* wait_for_condition will unlock LOCK_open for us */
    wait_for_condition(thd, &LOCK_open, &COND_refresh);
  }
The problem with this code is that the current implementation of the
LOGGER creates 'fake' THD objects, like
- Log_to_csv_event_handler::general_log_thd
- Log_to_csv_event_handler::slow_log_thd
which are not associated to a real thread running in the server,
so that waiting for these non-existing threads to release table locks
cause the dead lock.

In general, the design of Log_to_csv_event_handler does not fit into the
general architecture of the server, so that the concept of general_log_thd
and slow_log_thd has to be abandoned:
- this implementation does not work with table locking
- it will not work with commands like SHOW PROCESSLIST
- having the log tables always opened does not integrate well with DDL
operations / FLUSH TABLES / SET GLOBAL READ_ONLY

With this patch, the fundamental design of the LOGGER has been changed to:
- always open and close a log table when writing a log
- remove totally the usage of fake THD objects
- clarify how locking of log tables is implemented in general.

See WL#3984 for details related to the new locking design.

Additional changes (misc bugs exposed and fixed):

1)

mysqldump which would ignore some tables in dump_all_tables_in_db(),
 but forget to ignore the same in dump_all_views_in_db().

2)

mysqldump would also issue an empty "LOCK TABLE" command when all the tables
to lock are to be ignored (numrows == 0), instead of not issuing the query.

3)

Internal errors handlers could intercept errors but not warnings
(see sql_error.cc).

4)

Implementing a nested call to open tables, for the performance schema tables,
exposed an existing bug in remove_table_from_cache(), which would perform:
  in_use->some_tables_deleted=1;
against another thread, without any consideration about thread locking.
This call inside remove_table_from_cache() was not required anyway,
since calling mysql_lock_abort() takes care of aborting -- cleanly -- threads
that might hold a lock on a table.
This line (in_use->some_tables_deleted=1) has been removed.


sql/handler.cc:
  Moved logic for system / log tables in the SQL layer.
sql/handler.h:
  Moved logic for system / log tables in the SQL layer.
sql/lock.cc:
  Revised locking of log tables
sql/log.cc:
  Major cleanup: changed how log tables are locked / written to.
sql/log.h:
  Major cleanup: changed how log tables are locked / written to.
sql/mysql_priv.h:
  performance schema helpers
sql/slave.cc:
  open_ltable() lock flags
sql/sp.cc:
  open_ltable() lock flags
sql/sql_acl.cc:
  open_ltable() lock flags
sql/sql_class.h:
  performance schema helpers
sql/sql_delete.cc:
  log tables cleanup in TRUNCATE
sql/sql_error.cc:
  Internal handlers can also intercept warnings
sql/sql_insert.cc:
  open_ltable() lock flags
sql/sql_parse.cc:
  performance schema helpers
sql/sql_plugin.cc:
  open_ltable() lock flags
sql/sql_rename.cc:
  log tables cleanup in RENAME
sql/sql_servers.cc:
  open_ltable() lock flags
sql/sql_show.cc:
  Move INFORMATION_SCHEMA_NAME to table.cc
sql/sql_table.cc:
  log tables cleanup (admin operations, ALTER TABLE)
sql/sql_udf.cc:
  open_ltable() lock flags
sql/table.cc:
  Implemented TABLE_CATEGORY.
sql/share/errmsg.txt:
  Changed the wording and name of ER_CANT_READ_LOCK_LOG_TABLE
sql/table.h:
  Implemented TABLE_CATEGORY.
storage/csv/ha_tina.cc:
  Moved logic for system / log tables in the SQL layer.
storage/csv/ha_tina.h:
  Moved logic for system / log tables in the SQL layer.
storage/myisam/ha_myisam.cc:
  Moved logic for system / log tables in the SQL layer.
storage/myisam/ha_myisam.h:
  Moved logic for system / log tables in the SQL layer.
client/mysqldump.c:
  Don't lock tables in the ignore list.
  Don't issue empty LOCK TABLES queries.
sql/sql_base.cc:
  log tables cleanup
  performance schema helpers
mysql-test/r/ps.result:
  Adjust test results
mysql-test/r/show_check.result:
  Adjust test results
mysql-test/r/status.result:
  Adjust test results
mysql-test/t/log_state.test:
  Added tests for Bug#29129
mysql-test/t/ps.test:
  Make the test output deterministic
mysql-test/t/show_check.test:
  Make the test output deterministic
mysql-test/r/log_state.result:
  Changed the default location of the log output to LOG_FILE,
  for backward compatibility with MySQL 5.0
  ---
  Adjust test results
mysql-test/r/log_tables.result:
  cleanup for -ps-protocol
mysql-test/t/log_tables.test:
  cleanup for -ps-protocol
sql/set_var.cc:
  Changed the default location of the log output to LOG_FILE,
  for backward compatibility with MySQL 5.0
  ---
  log tables cleanup
2007-07-27 00:31:06 -06:00
unknown
935ce76278 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B29571-5.0-opt


sql/sql_insert.cc:
  Auto merged
2007-07-26 11:32:27 +03:00
unknown
5babac539d Bug #29571: INSERT DELAYED IGNORE written to binary log on
the master but on the slave

MySQL can decide to "downgrade" a INSERT DELAYED statement
to normal insert in certain situations.
One such situation is when the slave is replaying a 
replication feed.
However INSERT DELAYED is logged even if there're no updates
whereas the NORMAL INSERT is not logged in such cases.

Fixed by always logging a "downgraded" INSERT DELAYED: even 
if there were no updates.


mysql-test/r/rpl_insert_delayed.result:
  Bug #29571: test case
mysql-test/t/rpl_insert_delayed.test:
  Bug #29571: test case
sql/sql_insert.cc:
  Bug #29571: log INSERT DELAYED even if it was 
  "downgraded" to INSERT (and there were no updates)
2007-07-26 11:31:10 +03:00
unknown
6085445736 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.(none):/opt/local/work/mysql-5.1-runtime


mysql-test/r/create.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/innodb.test:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
2007-07-21 17:54:23 +04:00
unknown
568eccb513 Merge gleb.loc:/home/uchum/work/bk/5.1
into  gleb.loc:/home/uchum/work/bk/5.1-opt


mysql-test/t/disabled.def:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  SCCS merged
tests/mysql_client_test.c:
  SCCS merged
2007-07-20 04:21:46 +05:00
unknown
6c24dd7f0c A follow-up fix for Bug#29431 "killing an insert delayed thread causes
crash" in 5.1


sql/sql_insert.cc:
  Additional safety fix: do not assume we already have a share in 
  get_local_table.
2007-07-19 21:10:19 +04:00
unknown
1e9bdcfbcd Merge bodhi.(none):/opt/local/work/mysql-5.0-runtime
into  bodhi.(none):/opt/local/work/mysql-5.1-runtime


sql/sql_insert.cc:
  Manual merge.
2007-07-19 20:27:35 +04:00
unknown
62eb5f1794 Rename all references to 'Delayed_insert' instances from 'tmp' to 'di'
for consistency.
2007-07-19 19:36:52 +04:00
unknown
e81e55e783 A fix for Bug#29431 killing an insert delayed thread causes crash
No test case, since the bug requires a stress case with 30 INSERT DELAYED
threads and 1 killer thread to repeat. The patch is verified
manually.
Review fixes.

The server that is running DELAYED inserts would deadlock itself
or crash under high load if some of the delayed threads were KILLed
in the meanwhile.

The fix is to change internal lock acquisition order of delayed inserts
subsystem and to ensure that
Delayed_insert::table_list::db does not point to volatile memory in some 
cases.
For details, please see a comment for sql_insert.cc.


sql/sql_insert.cc:
  A fix for Bug#29431 killing an insert delayed thread causes crash
  
  1) The deadlock was caused by different lock acquisition order
  between delayed_get_table and handle_delayed_insert.
  
  delayed_get_table would:
  - acquire LOCK_delayed_create
  - create a new Delayed_insert instance
  - acquire instance mutex (di->mutex)
  - "lock the instance in memory" by 
  increasing di->locked_in_memory variable
  - start the delayed thread
  - release di->mutex
  - let the delayed thread open the delayed table
  - discover that the delayed thread was killed
  - try to unlock() the delayed insert instance in memory
  - in Delayed_insert::unlock() do
   * lock LOCK_delayed_insert
   * decrease locks_in_memory and discover it's 0
   * attempt to lock di->mutex to broadcast di->cond condition <-- deadlock
   here
  
  Meanwhile, the delayed thread would
   * lock di->mutex
   * open the table
   * get killed
   * not notice that and attempt to lock LOCK_delayed_insert
  to register itself in the delayed insert list <-- deadlock here.
  
  Simply put, delayed_get_table used to lock LOCK_delayed_insert and then 
  di->mutex, and handle_delayed_insert would lock di->mutex and then 
  LOCK_delayed_insert.
  
  Fixed by moving registration in the list of delayed insert threads from 
  handle_delayed_insert to delayed_get_table - so that now
  handle_delayed_insert doesn't need to acquire LOCK_delayed_insert mutex.
  
  
  2) di->table_list.db was copied by-pointer from table_list.db of the first
  producer -- the one who initiated creation of the delayed insert thread.
  This producer might be long gone when the member is needed
  (handle_delayed_insert:open_ltable),
  e.g. by having been killed with KILL CONNECTION statement.
  Fixed by using a pointer to the consumer's deep copy of THD::db.
  
  3) In find_handler, we shouldn't assume that Delayed_insert object
  already (or still) has a table opened all the time it is
  present in the delayed insert list. E.g. it's not the case
  when Delayed_insert decided to terminate, closed the table, but haven't
  yet unregistered from the list (see the end of handle_delayed_insert).
2007-07-19 19:28:00 +04:00
unknown
fcc51efc4d Bug #29692 Single row inserts can incorrectly report a huge number of row insertions
This bug was caused by unitialized value that was the result of a bad 5.0 merge.


sql/sql_class.h:
  Readded comments lost in a bad merge.
sql/sql_insert.cc:
  Fixed code to completely initialize (zero) the "COPY_INFO info" var in the same manner as the delayed write code.
  
  Readded a change that was lost in a bad merge.
tests/mysql_client_test.c:
  Test case added for bug#29692.
2007-07-16 14:53:05 -04:00
unknown
33e556ff55 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  moonbone.local:/mnt/gentoo64/work/29310-bug-5.1-opt-mysql


mysql-test/include/mix1.inc:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
sql/sql_insert.cc:
  Auto merged
2007-07-09 00:04:03 +04:00
unknown
a68a457be8 Bug#29310: An InnoDB table was updated when the data wasn't actually changed.
When a table is being updated it has two set of fields - fields required for
checks of conditions and fields to be updated. A storage engine is allowed
not to retrieve columns marked for update. Due to this fact records can't
be compared to see whether the data has been changed or not. This makes the
server always update records independently of data change.

Now when an auto-updatable timestamp field is present and server sees that
a table handle isn't going to retrieve write-only fields then all of such
fields are marked as to be read to force the handler to retrieve them.


mysql-test/r/innodb_mysql.result:
  Added a test case for the bug#29310: An InnoDB table was updated when the data wasn't actually changed.
mysql-test/include/mix1.inc:
  Added a test case for the bug#29310: An InnoDB table was updated when the data wasn't actually changed.
sql/sql_update.cc:
  Bug#29310: An InnoDB table was updated when the data wasn't actually changed.
  Now the mysql_update function when an auto-updatable timestamp field is
  present marks write-only fields as to be read to force the table handler
  to retrieve them.
sql/sql_insert.cc:
  Bug#29310: An InnoDB table was updated when the data wasn't actually changed.
  Now the write_record function can compare records when fileds to be written is
  a subset of the fields to be read while updating a record.
2007-07-08 18:13:04 +04:00
unknown
fec6d3f134 Merge anubis.xiphis.org:/usr/home/antony/work/mysql-5.0-engines
into  anubis.xiphis.org:/usr/home/antony/work/mysql-5.0-engines.merge


sql/sql_insert.cc:
  Auto merged
2007-07-06 09:00:40 -07:00
unknown
218ae8f3b1 Merge anubis.xiphis.org:/usr/home/antony/work/mysql-5.1-engines
into  anubis.xiphis.org:/usr/home/antony/work/mysql-5.1-merge


include/my_base.h:
  Auto merged
mysql-test/r/events_bugs.result:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
2007-07-01 20:56:47 -07:00
unknown
6b12505877 Merge synthia.local:/home/mydev/mysql-5.0-axmrg
into  synthia.local:/home/mydev/mysql-5.1-axmrg


mysql-test/r/federated.result:
  Auto merged
mysql-test/t/federated.test:
  Auto merged
include/my_base.h:
  Manual merge
sql/sql_insert.cc:
  Manual merge
storage/federated/ha_federated.cc:
  Manual merge
storage/federated/ha_federated.h:
  Manual merge
2007-06-30 13:17:49 +02:00
unknown
94beb7cd8d Bug#25511
"Federated INSERT failures"
  Federated does not correctly handle "INSERT...ON DUPLICATE KEY UPDATE"
  However, implementing such support is not reasonably possible without
  increasing complexity of the storage engine: checking that constraints
  on remote server match local server and parsing error messages.
  This patch causes 'ON DUPLICATE KEY' to fail with ER_DUP_KEY message
  if a conflict occurs and not to fail silently.


include/my_base.h:
  bug25511
    new storage engine hint: HA_EXTRA_INSERT_WITH_UPDATE
mysql-test/r/federated.result:
  test for bug25511
mysql-test/t/federated.test:
  test for bug25511
sql/ha_federated.cc:
  bug25511
    implement support for handling HA_EXTRA_INSERT_WITH_UPDATE hint
sql/ha_federated.h:
  bug25511
    new property: insert_dup_update
sql/sql_insert.cc:
  bug25511
    implement support for HA_EXTRA_INSERT_WITH_UPDATE
    When checking duplicates flag, if it is DUP_UPDATE, send hint
    to the storage engine.
2007-06-28 13:36:26 -07:00
unknown
ba4682ae10 Bug #29157: UPDATE, changed rows incorrect
Sometimes the number of really updated rows (with changed
column values) cannot be determined at the server level
alone (e.g. if the storage engine does not return enough
column values to verify that). So the only dependable way
in such cases is to let the storage engine return that
information if possible.
Fixed the bug at server level by providing a way for the 
storage engine to return information about wether it 
actually updated the row or the old and the new column 
values are the same. It can do that by returning 
HA_ERR_RECORD_IS_THE_SAME in ha_update_row().
Note that each storage engine may choose not to try to
return this status code, so this behaviour remains 
storage engine specific.


include/my_base.h:
  Bug #29157: handle the row not updated special return value
sql/log_event.cc:
  Bug #29157: handle the row not updated special return value
sql/sp.cc:
  Bug #29157: handle the row not updated special return value
sql/sql_acl.cc:
  Bug #29157: handle the row not updated special return value
sql/sql_insert.cc:
  Bug #29157: handle the row not updated special return value
sql/sql_servers.cc:
  Bug #29157: handle the row not updated special return value
sql/sql_update.cc:
  Bug #29157: handle the row not updated special return value
2007-06-28 16:07:55 +03:00
unknown
00b3d3c245 Merge mhansson@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  dl145s.mysql.com:/dev/shm/mhansson/my50-bug28677


sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2007-06-27 14:02:32 +02:00
unknown
25f0844386 Merge mhansson@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  dl145s.mysql.com:/dev/shm/mhansson/my51-bug28677


sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2007-06-25 12:50:12 +02:00