Commit graph

643 commits

Author SHA1 Message Date
mkindahl@dl145h.mysql.com
bdea24f483 Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl-merge
2007-12-19 18:51:46 +01:00
sven@riska.(none)
ab396c1d09 BUG#26395: if crash during autocommit update to transactional table on master, slave fails
Now, every transaction (including autocommit transactions) starts with
a BEGIN and ends with a COMMIT/ROLLBACK in the binlog.
Added a test case, and updated lots of test case result files.
2007-12-14 14:40:45 +01:00
kostja@bodhi.(none)
5b80d6a11b Fix broken embedded build (broken by the patch for Bug#12713, first part). 2007-12-13 23:58:55 +03:00
mkindahl@dl145h.mysql.com
6b5cb11dba Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-new-rpl
2007-11-14 11:07:30 +01:00
aelkin/elkin@koti.dsl.inet.fi
0dc13ecd38 Merge koti.dsl.inet.fi:/home/elkin/MySQL/TEAM/FIXES/5.0/bug27571_asyn_killed_flags
into  koti.dsl.inet.fi:/home/elkin/MySQL/merge-5.1
2007-11-06 20:41:06 +02:00
aelkin/elkin@koti.dsl.inet.fi
571f8be430 Bug #28597 Replication doesn't start after upgrading to 5.1.18
Since bug@20166, which replaced the binlog file name generating to base
on pidfile_name instead of the previous glob_hostname, the binlog file
name suddenly started to be stored solely in the absolute path format,
including a case when --log-bin option meant a relative path.
What's more serious, the path for binlog file can lead unrequestedly 
to pid-file directory so that after any proper fix for this bug
there might be similar to the bug report consequences for one who
upgrades from post-fix-bug@20166-pre-fix-bug@28597 to post-fix-bug@28597.

Fixed with preserving`pidfile_name' (intr.by bug@20166) but stripping
off its directory part. This restores the original logics of storing
the names in compatible with --log-bin option format and with the
requirement for --log-bin ralative path to corresond to the data directory.
Side effects for this fix:

effective fixing bug@27070, refining its test;
ensuring no overrun for buff can happen anymore (Bug#31836 
insufficient space reserved for the suffix of relay log file name);
bug#31837  --remove_file $MYSQLTEST_VARDIR/tmp/bug14157.sql missed
in rpl_temporary.test;
fixes Bug@28603  Invalid log-bin default location;
2007-11-05 17:20:10 +02:00
kostja@bodhi.(none)
230604f33c In ha_delete_table, use a standard mechanism to intercept the error message
and convert it to a warning instead of direct manipulation with the
thread error stack.
Fix a bug in handler::print_erorr when a garbled message was
printed for HA_ERR_NO_SUCH_TABLE.
This is a pre-requisite patch for the fix for Bug#12713 Error in a stored
function called from a SELECT doesn't cause ROLLBACK of statem
2007-10-30 22:35:14 +03:00
bar@bar.myoffice.izhnet.ru
70488d7dfe Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/bar/mysql-work/mysql-5.1-new-rpl-merge
2007-10-30 12:03:34 +04:00
kostja@bodhi.(none)
7c00f8a3b4 Rename: query_error -> is_slave_error.
Add comments.
2007-10-20 01:20:38 +04:00
davi@moksha.com.br
dd135211d8 Bug#21557 entries in the general query log truncated at 1000 characters.
The general log write function (general_log_print) uses printf style
arguments which need to be pre-processed, meaning that the all arguments
are copied to a single buffer and the problem is that the buffer size is
constant (1022 characters) but queries can be much larger then this.

The solution is to introduce a new log write function that accepts a
buffer and it's length as arguments. The function is to be used when
a formatted output is not required, which is the case for almost all
query write-to-log calls.

This is a incompatible change with respect to the log format of prepared
statements.
2007-10-18 15:45:07 -03:00
mats@kindahl-laptop.dnsalias.net
d8adc641a0 Merge kindahl-laptop.dnsalias.net:/home/bkroot/mysql-5.1-rpl
into  kindahl-laptop.dnsalias.net:/home/bk/b29549-mysql-5.1-target-5.1.22
2007-10-12 09:40:24 +02:00
malff/marcsql@weblab.(none)
6428dacd44 Bug#27858 (Failing to log to a log table doesn't log anything to error log)
Before this patch, failures to write to the log tables (mysql.slow_log
and mysql.general_log) were improperly printed (the time was printed twice),
or not printed at all.

With this patch, failures to write to the log tables is reported in the
error log, for all cases of failures.
2007-10-11 17:55:18 -06:00
mats@kindahl-laptop.dnsalias.net
c4298a3fb9 BUG#29549 (Endians: test failures on Solaris):
Refactoring code to add parameter to pack() and unpack() functions with
purpose of indicating if data should be packed in little-endian or
native order. Using new functions to always pack data for binary log
in little-endian order. The purpose of this refactoring is to allow
proper implementation of endian-agnostic pack() and unpack() functions.

Eliminating several versions of virtual pack() and unpack() functions
in favor for one single virtual function which is overridden in
subclasses.

Implementing pack() and unpack() functions for some field types that
packed data in native format regardless of the value of the
st_table_share::db_low_byte_first flag.

The field types that were packed in native format regardless are:
Field_real, Field_decimal, Field_tiny, Field_short, Field_medium,
Field_long, Field_longlong, and Field_blob.

Before the patch, row-based logging wrote the rows incorrectly on
big-endian machines where the storage engine defined its own
low_byte_first() to be FALSE on big-endian machines (the default
is TRUE), while little-endian machines wrote the fields in correct
order. The only known storage engine that does this is NDB. In effect,
this means that row-based replication from or to a big-endian
machine where the table was using NDB as storage engine failed if the
other engine was either non-NDB or on a little-endian machine.

With this patch, row-based logging is now always done in little-endian
order, while ORDER BY uses the native order if the storage engine
defines low_byte_first() to return FALSE for big-endian machines.

In addition, the max_data_length() function available in Field_blob
was generalized to the entire Field hierarchy to give the maximum
number of bytes that Field::pack() will write.
2007-10-11 18:18:05 +02:00
malff/marcsql@weblab.(none)
635f31822f Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-30712
2007-08-31 16:04:36 -06:00
kostja@bodhi.(none)
467de3981b Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  bodhi.(none):/opt/local/work/mysql-5.1-12713-new
2007-08-31 10:58:02 +04:00
kostja@bodhi.(none)
8d1af60da0 Never access thd->ha_data directly, use getters/setters from the plugin
API instead.
This is a pre-requisite of the fix for Bug 12713, which changes the
data type of thd->ha_data from void * to struct Ha_data.
2007-08-31 10:19:52 +04:00
malff/marcsql@weblab.(none)
88091e8250 Bug#30712 (open_performance_schema_table() cause an open table leak on
failures)

Fixed open_performance_schema_table() and close_performance_schema_table()
implementation and callers, to always execute balanced calls to:
  thd->reset_n_backup_open_tables_state(backup);
  thd->restore_backup_open_tables_state(backup);
2007-08-29 18:56:00 -06:00
jani@hynda.mysql.fi
2fd7a743e4 Merge hynda.mysql.fi:/home/my/mysql-5.1-main
into  hynda.mysql.fi:/home/my/mysql-5.1-marvel
2007-08-21 19:03:28 +03:00
mats@kindahl-laptop.dnsalias.net
112c64a00d Merge kindahl-laptop.dnsalias.net:/home/bkroot/mysql-5.1-rpl
into  kindahl-laptop.dnsalias.net:/home/bk/fix-mysql-5.1-rpl
2007-08-17 11:00:03 +02:00
mats@kindahl-laptop.dnsalias.net
9c4ef25c55 Renaming RELAY_LOG_INFO and st_relay_log_info to follow coding standards
(and be more friendly to Doxygen by removing unnecessary typedefs).
2007-08-16 07:37:50 +02:00
monty@mysql.com/narttu.mysql.fi
5d1c2dc913 Fixed problem that Start_log_event_v3::created was not set properly
(This is becasue 'when' is not anymore set in constructor)
2007-08-14 15:20:05 +03:00
monty@narttu.mysql.fi
9d609a59fd Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/my/mysql-5.1
2007-08-14 00:22:34 +03:00
monty@mysql.com/nosik.monty.fi
e53a73e26c 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()
2007-08-13 16:11:25 +03:00
df@pippilotta.erinye.com
493634e4c7 Merge bk-internal:/home/bk/mysql-5.1-marvel
into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build-marvel-engines
2007-08-03 17:15:23 +02:00
monty@mysql.com/nosik.monty.fi
113cd2d064 Removed compiler warning 2007-08-03 08:08:33 +03:00
monty@mysql.com/nosik.monty.fi
237d586700 Simplify logging code a bit (to make code smaller and faster)
Moved duplicated code to inline function store_timestamp()
Save thd->time_zone_used when logging to table as CSV internally cases it to be changed
Added MYSQL_LOCK_IGNORE_FLUSH to log tables to avoid deadlock in case of flush tables.
Mark log tables with TIMESTAMP_NO_AUTO_SET to avoid automatic timestamping
Set TABLE->no_replicate on open
2007-08-03 01:14:27 +03:00
monty@mysql.com/nosik.monty.fi
0174fa66d5 Don't save & restore time fields from thd when it's not needed.
Added back setting of 'some_tables_deleted' to not cause deadlocks in mysql_lock_table()
2007-08-02 10:50:00 +03:00
monty@nosik.monty.fi
93f0771fca Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/my/mysql-5.1
2007-08-02 07:55:33 +03:00
tsmith@ramayana.hindu.god
a52a078f75 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/51
2007-08-01 18:40:02 -06:00
malff/marcsql@weblab.(none)
be83a97fa6 Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-cleanup
2007-07-30 23:04:07 -06:00
malff/marcsql@weblab.(none)
edf784f444 Fixed ressource leak when activation of LOGGER failed. 2007-07-30 23:01:44 -06:00
serg@janus.mylan
f451ac1f96 handler::ha_write_row_no_binlog() hack removed,
existing table->no_replicate code is used instead
2007-07-30 19:56:02 +02:00
gkodinov/kgeorge@magare.gmz
cfbfb8bae8 (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
2007-07-30 19:02:21 +03:00
gkodinov/kgeorge@magare.gmz
9a0e6ec6d2 (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.
2007-07-30 18:27:36 +03:00
gkodinov/kgeorge@magare.gmz
b6bb988d12 Moved the DBUG_ASSERT from bug 28983 to
a place where it would not obstruct
correct multithreading.
2007-07-30 16:03:52 +03:00
monty@mysql.com/nosik.monty.fi
b16289a5e0 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()
2007-07-30 11:33:50 +03:00
malff/marcsql@weblab.(none)
ac7b17eac4 Code review changes 2007-07-27 12:19:36 -06:00
malff/marcsql@weblab.(none)
c7bbd8917c 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.
2007-07-27 00:31:06 -06:00
tnurnberg@sin.intern.azundris.com
f1b5fa93ac Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  mysql.com:/home/tnurnberg/22540/51-22540
2007-07-10 18:38:14 +02:00
tnurnberg@sin.intern.azundris.com
9b4c3d0db4 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/home/tnurnberg/22540/50-22540
2007-07-10 18:33:20 +02:00
tnurnberg@sin.intern.azundris.com
9310ad5f48 Merge mysql.com:/home/tnurnberg/22540/50-22540
into  mysql.com:/home/tnurnberg/22540/51-22540
2007-07-10 18:21:06 +02:00
tsmith@sita.local
5f12f35c34 Merge sita.local:/Users/tsmith/m/bk/51
into  sita.local:/Users/tsmith/m/bk/maint/51

This merge requires a post-merge fix to remove rpl_udf from
suite/rpl/t/disabled.def.
2007-07-09 03:27:03 -06:00
tsmith@sita.local
7b2b10e462 Merge sita.local:/Users/tsmith/m/bk/50
into  sita.local:/Users/tsmith/m/bk/maint/50
2007-07-09 01:22:54 -06:00
tnurnberg@mysql.com/sin.intern.azundris.com
3dfc83f1a1 Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
dollin' it up for Guilhem ;) -- test streamlined,
better comments, faster code, add'l assert.
2007-07-09 08:11:38 +02:00
tsmith@maint1.mysql.com
21b401bd26 WL#3914: Additonal accessors required to compile InnoDB as a plugin storage engine
Add more accessors to MySQL internals in mysql/plugin.h, for storage
engine plugins.

Add some accessors specific to the InnoDB storage engine, to allow
InnoDB to be compiled as a plugin (without MYSQL_SERVER).  InnoDB
has additional requirements, due to its foreign key support, etc.
2007-07-05 01:05:47 +02:00
gkodinov/kgeorge@magare.gmz
66bfc21362 Merge magare.gmz:/home/kgeorge/mysql/work/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/merge-5.1-opt
2007-07-04 11:46:45 +03:00
gkodinov/kgeorge@magare.gmz
bad7900a5a Bug #28983: 'reset master' in multiple threads and innodb tables
asserts debug binary

We can't reliably check if the binary log is opened without 
acquiring its mutex. 
Fixed by removing this check.
2007-07-03 10:36:37 +03:00
tnurnberg@sin.intern.azundris.com
2fbd3a2eca Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
minor fixes to appease pushbuild.
2007-07-02 07:13:40 +02:00
tnurnberg@sin.intern.azundris.com
5b98b71db6 Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
previous correction didn't. make sure "tail" is fixed up
when filling cache several times; rework formulae.
---
Merge sin.intern.azundris.com:/home/tnurnberg/22540/50-22540
into  sin.intern.azundris.com:/home/tnurnberg/22540/51-22540
2007-06-30 03:32:33 +02:00
tnurnberg@sin.intern.azundris.com
1ac88a2b41 Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
previous correction didn't. make sure "tail" is fixed up
when filling cache several times; rework formulae.
2007-06-30 02:30:42 +02:00