Commit graph

565 commits

Author SHA1 Message Date
mats@romeo.(none)
93860556e6 Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/b25688-mysql-5.1-rpl
2007-04-12 09:10:45 +02:00
mats@romeo.(none)
11fc24ef24 BUG#25688 (RBR: circular replication may cause STMT_END_F flags to be
skipped):

By moving statement end actions from Rows_log_event::do_apply_event() to
Rows_log_event::do_update_pos() they will always be executed, even if
Rows_log_event::do_apply_event() is skipped because the event originated
at the same server. This because Rows_log_event::do_update_pos() is always
executed (unless Rows_log_event::do_apply_event() failed with an error,
in which case the slave stops with an error anyway). 

Adding test case.

Fixing logic to detect if inside a group. If a rotate event occured
when an initial prefix of events for a statement, but for which the
table did contain a key, last_event_start_time is set to zero, causing
rotate to end the group but without unlocking any tables. This left a
lock hanging around, which subsequently triggered an assertion when a
second attempt was made to lock the same sequence of tables.

In order to solve the above problem, a new flag was added to the relay
log info structure that is used to indicate that the replication thread
is currently executing a statement. Using this flag, the replication
thread is in a group if it is either in a statement or inside a trans-
action.

The patch also eliminates some gratuitous header file inclusions that
were not needed (and caused compile errors) and replaced them with
forward definitions.
2007-04-12 08:58:04 +02:00
tsmith@quadxeon.mysql.com
e9fd9a18e0 Bug #27638: slow logging to CSV table inserts bad query_time and lock_time values
When MySQL logged slow query information to a CSV table, it stored the
query_time and lock_time values with an incorrect formula.

If the time was over 59 seconds, this caused incorrect statistics (either the
slow query was not logged, or the time was far from correct).  This change
fixes the method used to store those TIME values in the slow_log table.
2007-04-04 21:40:47 +02:00
msvensson@pilot.blaudden
fc904eaead Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.1
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint
2007-04-02 11:15:09 +02:00
lars/lthalmann@dl145j.mysql.com
771e05d657 Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.1-new-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.1-merge
2007-03-29 13:49:10 +02:00
tsmith@siva.hindu.god
0d65ee796b Merge siva.hindu.god:/home/tsmith/m/bk/maint/50
into  siva.hindu.god:/home/tsmith/m/bk/maint/51
2007-03-28 19:50:41 -06:00
tsmith@siva.hindu.god
024be23a82 Fix warning on Windows 2007-03-28 19:49:30 -06:00
tsmith@siva.hindu.god
16640ef3fe Merge siva.hindu.god:/home/tsmith/m/bk/maint/50
into  siva.hindu.god:/home/tsmith/m/bk/maint/51
2007-03-28 17:54:11 -06:00
tsmith@siva.hindu.god
979102de3b Remove warning when compiling libmysqld/log.cc 2007-03-28 17:50:06 -06:00
msvensson@pilot.blaudden
0302f48c2d Merge pilot.blaudden:/home/msvensson/mysql/bug27490/my50-bug27490
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
2007-03-28 18:43:39 +02:00
msvensson@pilot.blaudden
b95a1819bf Merge pilot.blaudden:/home/msvensson/mysql/bug27490/my50-bug27490
into  pilot.blaudden:/home/msvensson/mysql/bug27490/my51-bug27490
2007-03-28 18:37:27 +02:00
msvensson@pilot.blaudden
b82b20cd83 Bug#27490 Function to log to NT event log could allocate memory
- Change 'print_buffer_to_nt_event_log' to overwrite the string
if the buffer is not long enough to hold the ending CR/LF's
- Make functions static
- Remove the "hack" intended to force 'print_buffer_to_nt_event_log'
 never to use "new"
2007-03-28 10:12:33 +02:00
mats@romeo.(none)
68ebc7e495 Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/b23171-mysql-5.1-new-rpl
2007-03-22 09:05:11 +01:00
msvensson@pilot.blaudden
7c5df4d35b Merge bk-internal:/home/bk/mysql-5.1-new-maint
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint
2007-03-21 14:24:50 +01:00
aelkin/elkin@dsl-hkibras1-ff1dc300-249.dhcp.inet.fi
ac1c81ddcf Merge dsl-hkibras1-ff1dc300-249.dhcp.inet.fi:/home/elkin/MySQL/TEAM/FIXES/5.1/bug26079_binlog_max_innodb
into  dsl-hkibras1-ff1dc300-249.dhcp.inet.fi:/home/elkin/MySQL/MAIN/mysql-5.1-new-maint
2007-03-21 13:14:12 +02:00
msvensson@pilot.blaudden
80fb08310e Bug#27070 server logs are created unrequested and in wrong directory
- Avoid defaault log file names looking like <hostname>.pid.slow.log
  by using the FN_REPLACE_EXT flag to 'fn_format'
 - Remove the default log files generated by log_state.test before
   test completes
2007-03-20 11:21:27 +01:00
aelkin/elkin@dsl-hkibras1-ff1dc300-249.dhcp.inet.fi
7c22049dfa Bug #26079 max_binlog_size + innodb = not make new binlog and hang server
There was hanging at binlog_commit by a thread executing autocommit query.

The hang appeared to be due to an overly condtion for early return 
from binlog_commit introduced by bug#20265 fix.

Fixed with reverting the logic back to 5.0 version.
2007-03-20 10:50:10 +02:00
serg@janus.mylan
f813272125 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  janus.mylan:/usr/home/serg/Abk/mysql-5.1
2007-03-16 14:09:30 +01:00
msvensson@pilot.blaudden
8a8c69f3fd Fix 6 warnings from win64, where one is a potential bug. 2007-03-08 14:29:29 +01:00
tsmith@quadxeon.mysql.com
79191807ff Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mrg0306/51
2007-03-07 07:21:24 +01:00
serg@janus.mylan
6aa5c001c5 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  janus.mylan:/usr/home/serg/Abk/mysql-5.1
2007-03-06 13:44:57 +01:00
msvensson@pilot.blaudden
f5778fc73e Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
2007-03-01 18:12:56 +01:00
msvensson@pilot.blaudden
51a71fb667 Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.1
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint
2007-03-01 14:53:32 +01:00
lars/lthalmann@mysql.com/dl145j.mysql.com
2f5a2b2476 Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge
2007-03-01 11:37:28 +01:00
lars/lthalmann@dl145k.mysql.com
504b4d2dfb Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.1-new-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.1-merge
2007-02-28 22:32:44 +01:00
jani@ua141d10.elisa.omakaista.fi
bcbc0031eb Fixed compiler warnings. 2007-02-28 22:23:35 +02:00
monty@mysql.com/narttu.mysql.fi
cfef5d04b3 Remove compiler warnings 2007-02-27 19:31:49 +02:00
cbell/Chuck@mysql_cab_desk.
995f2ae13f Merge cbell@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl
into  mysql_cab_desk.:C:/source/C++/mysql-5.1-new-rpl
2007-02-26 14:33:58 -05:00
cbell/Chuck@mysql_cab_desk.
e9481608c3 Merge cbell@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  mysql_cab_desk.:C:/source/c++/mysql-5.0-rpl
2007-02-26 14:30:44 -05:00
cbell/Chuck@mysql_cab_desk.
d7e4de9937 BUG#20141 "User-defined variables are not replicated properly for
SF/Triggers in SBR mode."
BUG#14914 "SP: Uses of session variables in routines are not always replicated"
BUG#25167 "Dupl. usage of user-variables in trigger/function is not replicated
          correctly"

User-defined variables used inside of stored functions/triggers in
statements which did not update tables directly were not replicated.
We also had problems with replication of user-defined variables which
were used in triggers (or stored functions called from table-updating
statements) more than once.

This patch addresses the first issue by enabling logging of all
references to user-defined variables in triggers/stored functions
and not only references from table-updating statements.

The second issue stemmed from the fact that for user-defined
variables used from triggers or stored functions called from
table-updating statements we were writing binlog events for each
reference instead of only one event for the first reference.
This problem is already solved for stored functions called from
non-updating statements with help of "event unioning" mechanism.
So the patch simply extends this mechanism to the case affected.
It also fixes small problem in this mechanism which caused wrong
logging of references to user-variables in cases when non-updating
statement called several stored functions which used the same
variable and some of these function calls were omitted from binlog
as they were not updating any tables.
2007-02-26 14:06:10 -05:00
mats@romeo.(none)
75be2a8b65 Eliminating compiler warnings in the sql/ directory. 2007-02-26 18:05:08 +01:00
serg@janus.mylan
30321673a2 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  janus.mylan:/usr/home/serg/Abk/mysql-5.1
2007-02-26 16:12:40 +01:00
mats@romeo.(none)
959b881022 Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/b25091-mysql-5.1-new-rpl
2007-02-26 10:54:26 +01:00
mats@romeo.(none)
988ae560f3 Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/b25091-mysql-5.1-new-rpl
2007-02-26 10:43:31 +01:00
mats@romeo.(none)
f910199270 BUG#25091 (A DELETE statement to mysql database is not logged in ROW format):
With this patch, statements that change metadata (in the mysql database)
is logged as statements, while normal changes (e.g., using INSERT, DELETE,
and/or UPDATE) is logged according to the format in effect.

The log tables (i.e., general_log and slow_log) are not replicated at all.

With this patch, the following statements are replicated as statements:
GRANT, REVOKE (ALL), CREATE USER, DROP USER, and RENAME USER.
2007-02-26 10:19:08 +01:00
lars/lthalmann@dl145j.mysql.com
e1867c3156 Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.1-new-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.1-merge
2007-02-25 00:12:14 +01:00
lars/lthalmann@mysql.com/dl145j.mysql.com
1a09fb81fc Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge
2007-02-25 00:10:51 +01:00
lars/lthalmann@dl145h.mysql.com
8b39189ee4 Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.1-new-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.1-merge
2007-02-24 11:52:08 +01:00
cbell/Chuck@mysql_cab_desk.
9017512bd6 Merge mysql_cab_desk.:C:/source/c++/mysql-5.0-rpl
into  mysql_cab_desk.:C:/source/c++/mysql-5.0_BUG_20141
2007-02-23 13:00:08 -05:00
cbell/Chuck@mysql_cab_desk.
4c6ced9fc5 BUG#20141 "User-defined variables are not replicated properly for SF/
Triggers in SBR mode."
BUG#14914 "SP: Uses of session variables in routines are not always
           replicated"
BUG#25167 "Dupl. usage of user-variables in trigger/function is not
           replicated correctly"

User-defined variables used inside of stored functions/triggers in
statements which did not update tables directly were not replicated.
We also had problems with replication of user-defined variables which
were used in triggers (or stored functions called from table-updating
statements) more than once.

This patch addresses the first issue by enabling logging of all
references to user-defined variables in triggers/stored functions
and not only references from table-updating statements.

The second issue stemmed from the fact that for user-defined
variables used from triggers or stored functions called from
table-updating statements we were writing binlog events for each
reference instead of only one event for the first reference.
This problem is already solved for stored functions called from
non-updating statements with help of "event unioning" mechanism.
So the patch simply extends this mechanism to the case affected.
It also fixes small problem in this mechanism which caused wrong
logging of references to user-variables in cases when non-updating
statement called several stored functions which used the same
variable and some of these function calls were omitted from binlog
as they were not updating any tables.
2007-02-23 12:58:56 -05:00
mats@romeo.(none)
2114ea31d2 Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/b19033-mysql-5.1-new-rpl
2007-02-23 14:59:48 +01:00
monty@mysql.com/narttu.mysql.fi
f0ae3ce9b9 Fixed compiler warnings
Fixed compile-pentium64 scripts
Fixed wrong estimate of update_with_key_prefix in sql-bench
Merge bk-internal.mysql.com:/home/bk/mysql-5.1 into mysql.com:/home/my/mysql-5.1
Fixed unsafe define of uint4korr()
Fixed that --extern works with mysql-test-run.pl
Small trivial cleanups
This also fixes a bug in counting number of rows that are updated when we have many simultanous queries
Move all connection handling and command exectuion main loop from sql_parse.cc to sql_connection.cc
Split handle_one_connection() into reusable sub functions.
Split create_new_thread() into reusable sub functions.
Added thread_scheduler; Preliminary interface code for future thread_handling code.

Use 'my_thread_id' for internal thread id's
Make thr_alarm_kill() to depend on thread_id instead of thread
Make thr_abort_locks_for_thread() depend on thread_id instead of thread
In store_globals(), set my_thread_var->id to be thd->thread_id.
Use my_thread_var->id as basis for my_thread_name()
The above changes makes the connection we have between THD and threads more soft.

Added a lot of DBUG_PRINT() and DBUG_ASSERT() functions
Fixed compiler warnings
Fixed core dumps when running with --debug
Removed setting of signal masks (was never used)
Made event code call pthread_exit() (portability fix)
Fixed that event code doesn't call DBUG_xxx functions before my_thread_init() is called.
Made handling of thread_id and thd->variables.pseudo_thread_id uniform.
Removed one common 'not freed memory' warning from mysqltest
Fixed a couple of usage of not initialized warnings (unlikely cases)
Suppress compiler warnings from bdb and (for the moment) warnings from ndb
2007-02-23 13:13:55 +02:00
serg@janus.mylan
689eed7406 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  janus.mylan:/usr/home/serg/Abk/mysql-5.1
2007-02-21 11:36:23 +01:00
msvensson@pilot.blaudden
0af1b19568 Bug#20166 mysql-test-run.pl does not test system privilege tables creation
- Fixes for 5.1
2007-02-20 16:29:56 +01:00
msvensson@pilot.blaudden
0cc2e14040 Merge pilot.blaudden:/home/msvensson/mysql/bug20166/my50-bug20166
into  pilot.blaudden:/home/msvensson/mysql/bug20166/my51-bug20166
2007-02-20 16:26:30 +01:00
msvensson@pilot.blaudden
6caa0a232e Bug#20166 mysql-test-run.pl does not test system privilege tables creation
- Part 2, add @@hostname system variable
2007-02-20 16:24:38 +01:00
guilhem@gbichot3.local
03dfe4ab3f Merge gbichot3.local:/home/mysql_src/mysql-5.0-rpl-25507
into  gbichot3.local:/home/mysql_src/mysql-5.1-rpl-25507
2007-02-15 16:05:22 +01:00
guilhem@gbichot3.local
2f75c9cd69 Backport from the Falcon tree.
When opening/creating the transaction coordinator's log, if binlog is
used, the tc log is the binlog so we use the binlog's name; otherwise
we use the mmap-based log, named after the mandatory argument of the
--log-tc option (meant for that).
2007-02-15 15:50:56 +01:00
serg@janus.mylan
a07fd5fa8f WL#3700: Handler API change: all index search methods - that is,
index_read(), index_read_idx(), index_read_last(), and
records_in_range() - instead of 'uint keylen' argument take
'ulonglong keypart_map', a bitmap showing which keyparts are
present in the key value.
Fallback method is provided for handlers that are lagging behind.
2007-01-29 10:40:26 +01:00
monty@mysql.com/narttu.mysql.fi
410fc81a72 After merge fixes
Removed a lot of compiler warnings
Removed not used variables, functions and labels
Initialize some variables that could be used unitialized (fatal bugs)
%ll -> %l
2007-01-29 01:47:35 +02:00