Commit graph

894 commits

Author SHA1 Message Date
mats@kindahl-laptop.dnsalias.net
5c662d6d7c Merge mkindahl@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl
into  kindahl-laptop.dnsalias.net:/home/bk/b28618-mysql-5.1-rpl
2007-05-31 20:17:31 +02:00
mats@kindahl-laptop.dnsalias.net
b1bd9a6c4f BUG#28618 (Skipping into the middle of a group with
SQL_SLAVE_SKIP_COUNTER is possible):

By setting the SQL_SLAVE_SKIP_COUNTER it was possible to start the
from the middle of a group. This patch adds code so that events that
do not end a statement are ignored instead of skip counted when the
slave skip counter is 1.
2007-05-31 20:01:06 +02:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
c98fa25956 Fix for bug #28436: Incorrect position in SHOW BINLOG EVENTS causes server coredump
Problem: there is an ASSERT() in the Log_event::read_log_event() checking the integrity 
of the event's data that may fail.
Fix: move the assert's condition to an explicit check.
2007-05-30 15:23:47 +05:00
lars/lthalmann@mysql.com/dl145k.mysql.com
a6cf35bb78 Added extra parenthesis to remove compiler warning
Fixed test case rpl_incident.test (synchronize drop table, masked IO thread behaviour)
2007-05-30 11:55:56 +02:00
aelkin/elkin@dsl-hkibras1-ff5dc300-70.dhcp.inet.fi
1f12c44b91 Merge dsl-hkibras1-ff5dc300-70.dhcp.inet.fi:/home/elkin/MySQL/TEAM/FIXES/5.1/bug27044_slave_dup2unique
into  dsl-hkibras1-ff5dc300-70.dhcp.inet.fi:/tmp/merge_5.0
2007-05-30 11:22:07 +03:00
aelkin/elkin@dsl-hkibras1-ff5dc300-70.dhcp.inet.fi
f7c3285f2e Bug#27044 replicated with unique field ndb table allows duplkey inserts
The bug in that slave version of a table with unique field still was
able to execute INSERT query as replace whereas it's impossible on master.

The reason of this artifact is wrong usage of ndb->extra:s.

Fixed with resetting flags at do_after.
There is open issue with symmetrical resetting
   table->file->extra(HA_EXTRA_NO_IGNORE_NO_KEY)
which i had to hand to bug#27077.
The test for the current bug was committed in a cset for bug#27320.
2007-05-29 16:36:05 +03:00
aelkin/elkin@dsl-hkibras1-ff5dc300-70.dhcp.inet.fi
573df947b8 Merge dsl-hkibras1-ff5dc300-70.dhcp.inet.fi:/home/elkin/MySQL/TEAM/BARE/5.0
into  dsl-hkibras1-ff5dc300-70.dhcp.inet.fi:/tmp/merge_5.0
2007-05-28 23:34:04 +03:00
aelkin/elkin@dsl-hkibras1-ff5dc300-70.dhcp.inet.fi
b8a5a770f0 Bug#22725 Replication outages from ER_SERVER_SHUTDOWN (1053) set in replication events
The reason for the bug was that replaying of a query on slave could not be possible since its event
was recorded with the killed error. Due to the specific of handling INSERT, which per-row-while-loop is 
unbreakable to killing, the query on transactional table should have not appeared in binlog unless
there was  a call to a stored routine that got interrupted with killing (and then there must be an error
returned out of the loop).
   
The offered solution added the following rule for binlogging of INSERT that accounts the above
specifics:
For INSERT on transactional-table if the error was not set the only raised flag
is harmless and is ignored via masking out on time of creation of binlog event.
   
For both table types the combination of raised error and KILLED flag indicates that there
was potentially partial execution on master and consistency is under the question.
In that case the code continues to binlog an event with an appropriate killed error.
 
The fix relies on the specified behaviour of stored routine that must propagate the error 
to the top level query handling if the thd->killed flag was raised in the routine execution.
   
The patch adds an arg with the default killed-status-unset value to Query_log_event::Query_log_event.
2007-05-28 22:20:22 +03:00
jani@a88-113-38-195.elisa-laajakaista.fi
fc3b3a0a86 Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1
into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel
2007-05-24 13:24:36 +03:00
monty@mysql.com/narttu.mysql.fi
088e2395f1 WL#3817: Simplify string / memory area types and make things more consistent (first part)
The following type conversions was done:

- Changed byte to uchar
- Changed gptr to uchar*
- Change my_string to char *
- Change my_size_t to size_t
- Change size_s to size_t

Removed declaration of byte, gptr, my_string, my_size_t and size_s. 

Following function parameter changes was done:
- All string functions in mysys/strings was changed to use size_t
  instead of uint for string lengths.
- All read()/write() functions changed to use size_t (including vio).
- All protocoll functions changed to use size_t instead of uint
- Functions that used a pointer to a string length was changed to use size_t*
- Changed malloc(), free() and related functions from using gptr to use void *
  as this requires fewer casts in the code and is more in line with how the
  standard functions work.
- Added extra length argument to dirname_part() to return the length of the
  created string.
- Changed (at least) following functions to take uchar* as argument:
  - db_dump()
  - my_net_write()
  - net_write_command()
  - net_store_data()
  - DBUG_DUMP()
  - decimal2bin() & bin2decimal()
- Changed my_compress() and my_uncompress() to use size_t. Changed one
  argument to my_uncompress() from a pointer to a value as we only return
  one value (makes function easier to use).
- Changed type of 'pack_data' argument to packfrm() to avoid casts.
- Changed in readfrm() and writefrom(), ha_discover and handler::discover()
  the type for argument 'frmdata' to uchar** to avoid casts.
- Changed most Field functions to use uchar* instead of char* (reduced a lot of
  casts).
- Changed field->val_xxx(xxx, new_ptr) to take const pointers.

Other changes:
- Removed a lot of not needed casts
- Added a few new cast required by other changes
- Added some cast to my_multi_malloc() arguments for safety (as string lengths
  needs to be uint, not size_t).
- Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done
  explicitely as this conflict was often hided by casting the function to
  hash_get_key).
- Changed some buffers to memory regions to uchar* to avoid casts.
- Changed some string lengths from uint to size_t.
- Changed field->ptr to be uchar* instead of char*. This allowed us to
  get rid of a lot of casts.
- Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar
- Include zlib.h in some files as we needed declaration of crc32()
- Changed MY_FILE_ERROR to be (size_t) -1.
- Changed many variables to hold the result of my_read() / my_write() to be
  size_t. This was needed to properly detect errors (which are
  returned as (size_t) -1).
- Removed some very old VMS code
- Changed packfrm()/unpackfrm() to not be depending on uint size
  (portability fix)
- Removed windows specific code to restore cursor position as this
  causes slowdown on windows and we should not mix read() and pread()
  calls anyway as this is not thread safe. Updated function comment to
  reflect this. Changed function that depended on original behavior of
  my_pwrite() to itself restore the cursor position (one such case).
- Added some missing checking of return value of malloc().
- Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow.
- Changed type of table_def::m_size from my_size_t to ulong to reflect that
  m_size is the number of elements in the array, not a string/memory
  length.
- Moved THD::max_row_length() to table.cc (as it's not depending on THD).
  Inlined max_row_length_blob() into this function.
- More function comments
- Fixed some compiler warnings when compiled without partitions.
- Removed setting of LEX_STRING() arguments in declaration (portability fix).
- Some trivial indentation/variable name changes.
- Some trivial code simplifications:
  - Replaced some calls to alloc_root + memcpy to use
    strmake_root()/strdup_root().
  - Changed some calls from memdup() to strmake() (Safety fix)
  - Simpler loops in client-simple.c
2007-05-10 12:59:39 +03:00
malff/marcsql@weblab.(none)
e22cbec571 Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-rt-merge
2007-05-02 12:11:25 -06:00
cmiller@zippy.cornsilk.net
71a0ecee6e Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-enterprise-formergecomm
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-unified02
2007-04-27 16:45:01 -04:00
malff/marcsql@weblab.(none)
62fd6aa696 manual merge 5.0-runtime -> 5.1->runtime, with 25411 part I 2007-04-25 21:38:12 -06:00
malff/marcsql@weblab.(none)
18d7ed6564 Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-runtime
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-25411_merge
2007-04-25 15:39:40 -06:00
cmiller@zippy.cornsilk.net
9dd7812fec Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community-formerge51
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-enterprise-formergecomm
2007-04-25 08:14:46 -04:00
malff/marcsql@weblab.(none)
fc809c70cc Bug#25411 (trigger code truncated), PART I
The issue found with bug 25411 is due to the function skip_rear_comments()
which damages the source code while implementing a work around.
The root cause of the problem is in the lexical analyser, which does not
process special comments properly.
For special comments like :
[1] aaa /*!50000 bbb */ ccc
since 5.0 is a version older that the current code, the parser is in lining
the content of the special comment, so that the query to process is
[2] aaa bbb ccc
However, the text of the query captured when processing a stored procedure,
stored function or trigger (or event in 5.1), can be after rebuilding it:
[3] aaa bbb */ ccc
which is wrong.

To fix bug 25411 properly, the lexical analyser needs to return [2] when
in lining special comments.
In order to implement this, some preliminary cleanup is required in the code,
which is implemented by this patch.

Before this change, the structure named LEX (or st_lex) contains attributes
that belong to lexical analysis, as well as attributes that represents the
abstract syntax tree (AST) of a statement.
Creating a new LEX structure for each statements (which makes sense for the
AST part) also re-initialized the lexical analysis phase each time, which
is conceptually wrong.

With this patch, the previous st_lex structure has been split in two:
- st_lex represents the Abstract Syntax Tree for a statement. The name "lex"
has not been changed to avoid a bigger impact in the code base.
- class lex_input_stream represents the internal state of the lexical
  analyser, which by definition should *not* be reinitialized when parsing
  multiple statements from the same input stream.

This change is a pre-requisite for bug 25411, since the implementation of
lex_input_stream will later improve to deal properly with special comments,
and this processing can not be done with the current implementation of
sp_head::reset_lex and sp_head::restore_lex, which interfere with the lexer.

This change set alone does not fix bug 25411.
2007-04-24 09:24:21 -06:00
iggy@recycle.(none)
4bde20d175 Bug #27691 bk compilation with VC++ 2005 fails
- Added appropiate casts.
2007-04-23 16:42:57 -04:00
mats@capulet.net
d45e738b71 Fixes to make it compile when using Sun CC and restoring some changes
done in previous patches.

There is an error in the Sun CC compiler that treats parameters that
differ in only qualifier as different, even though this is not
allowed by the standard (ISO/IEC 14882:2003, Section 13.1).
2007-04-13 19:19:10 +02:00
mats@romeo.(none)
84ec7be2c7 WL#2735: Refactor replication
Factoring out pack_row() and unpack_row() into new files
rpl_record.{cc,h}.
2007-04-13 14:55:28 +02:00
mats@romeo.(none)
490bed495e Merge romeo.(none):/home/bkroot/mysql-5.1-rpl
into  romeo.(none):/home/bk/b27779-mysql-5.1-rpl
2007-04-13 08:55:03 +02:00
mats@romeo.(none)
06faf8f411 BUG#27779 (Slave cannot read old rows log events):
Taking code from before BUG#22583 and incorporating as events to be able
to read old events. Also incorporating old pack and unpack functions
into patch.
2007-04-12 15:50:54 +02:00
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
mats@romeo.(none)
651358e1f5 BUG#27583 (slave sql fails to read from iocache when slave got
stopped at pos==4):

Submitting patch on behalf of Andrei, who discovered the problem
and provided the patch.

An update of the group relay log coordinates when rotating forgot to
update the group relay log name and only updated the group relay log
position (and group master log name and position).

This patch adds code to update the group relay log *name* as well as
the position
2007-04-11 11:10:14 +02:00
cmiller@zippy.cornsilk.net
5f4dfdd5fe Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
2007-04-03 09:20:22 -04: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
mats@romeo.(none)
4710d3df33 WL#3464 (Add replication event to denote gap in replication):
Fixing automerge problem and updating comments referring to exec_event().
2007-03-30 15:29:30 +02:00
mats@romeo.(none)
82c71a60f7 - Fixing binary log positions
- Eliminating some compiler warnings
2007-03-30 10:27:08 +02:00
mats@romeo.(none)
e12cc44ac3 Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/w3464-mysql-5.1-new-rpl
2007-03-29 21:38:03 +02:00
mats@romeo.(none)
7c187c2c9b WL#3464: Add replication event to denote gap in replication
Adding an event that can be used to denote that an incident occured
on the master. The event can be used to denote a gap in the replication
stream, but can also be used to denote other incidents.

In addition, the injector interface is extended with functions to
generate an incident event. The function will also rotate the binary
log after generating an incident event to get a fresh binary log.
2007-03-29 20:31: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
msvensson@pilot.blaudden
38172437e3 Merge pilot.blaudden:/home/msvensson/mysql/bug26837/my50-bug26837
into  pilot.blaudden:/home/msvensson/mysql/bug26837/my51-bug26837
2007-03-29 12:34:18 +02:00
mats@romeo.(none)
0488fd87c8 Eliminating some warnings. 2007-03-28 15:30:03 +02:00
mats@romeo.(none)
7054aaaafa Eliminating a warning for unused variable in non-debug build. 2007-03-27 18:04:02 +02:00
mats@romeo.(none)
d0ce263f56 Eliminating some compiler warnings. 2007-03-27 17:45:23 +02:00
mats@romeo.(none)
06b5e9bb53 BUG#27441 (There is no COLS bitmap for the after image of an update
rows event):

Adding a after image COLS bitmap to Update_rows_log_event (for telling
what columns that are present in the after image of each row update).

Also fixing case where Rows_log_event length was not correctly computed
(happened when the number of columns in a table was more than 251).
2007-03-27 12:17:51 +02:00
mats@romeo.(none)
6269e4f216 Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/b22583-mysql-5.1-new-rpl
2007-03-26 09:02:38 +02:00
msvensson@pilot.blaudden
696102a8c6 Bug#26837 Return value ignored for packet->append() call within Log_event::read_log_event
- Improve error handling for "out of memory" problems when master is
   sending logs to slave. If memory allocation fails the log should
   now  report error "memory allocation failed reading log event"
2007-03-23 19:00:34 +01:00
mats@romeo.(none)
08bb33dbd7 Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/b22583-mysql-5.1-new-rpl
2007-03-22 17:34:25 +01:00
guilhem@gbichot3.local
68cc7dde31 Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-5.1-rpl
into  gbichot3.local:/home/mysql_src/mysql-5.1-rpl-26194
2007-03-22 17:32:37 +01:00
guilhem@gbichot3.local
21492b54b4 Fix for BUG#26194 "mysqlbinlog --base64-output produces invalid SQL";
when it was printing a Query event, it produced invalid SQL (missing
the BINLOG keyword, so the SQL started with the base64 string, which
is incorrect).
Note: no testcase; I have a .test which shows that the bugfix works,
but it triggers BUG#26361 and so gives Valgrind warnings. I'm sending
this test to the fixer of BUG#26361 for her/him to push when she/he
fixes BUG#26361.
2007-03-22 17:31:39 +01:00
mats@romeo.(none)
82f3f318c6 BUG#23171: Illegal group log position
Post-merge fixes.
2007-03-22 16:59:55 +01: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
mats@romeo.(none)
2ee007ba9d BUG#23171: Illegal group log position
Tail fixes after re-applying patches to older version of clone.
2007-03-22 08:32:41 +01:00
mats@romeo.(none)
6a01170299 Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/b22583-mysql-5.1-new-rpl
2007-03-20 09:35:56 +01:00
mats@romeo.(none)
d695f74955 BUG#22583: RBR between MyISAM and non-MyISAM tables containing a BIT
field does not work

Fix to prevent MyISAM from reading data from NULL BLOB.
Fix to make record comparison independent of values of unused bits in
record.
Updating binlog positions in tests.
2007-03-20 08:52:01 +01:00
kostja@bodhi.local
bdb10baec1 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.local:/opt/local/work/mysql-5.1-runtime
2007-03-20 00:42:11 +03:00
serg@janus.mylan
68fd66e853 wl#3700 - post-review fixes:
s/ulonglong/key_part_map/, comments
2007-03-17 00:13:25 +01: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
malff/marcsql@weblab.(none)
62247621b0 Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-runtime
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-26503-merge
2007-03-14 15:36:11 -06:00
kroki/tomash@moonlight.home
7bbea96754 Merge moonlight.home:/home/tomash/src/mysql_ab/mysql-5.1
into  moonlight.home:/home/tomash/src/mysql_ab/mysql-5.1-bug9953
2007-03-09 13:17:46 +03:00
kroki/tomash@moonlight.home
c19affef54 BUG#9953: CONVERT_TZ requires mysql.time_zone_name to be locked
The problem was that some facilities (like CONVERT_TZ() function or
server HELP statement) may require implicit access to some tables in
'mysql' database.  This access was done by ordinary means of adding
such tables to the list of tables the query is going to open.
However, if we issued LOCK TABLES before that, we would get "table
was not locked" error trying to open such implicit tables.

The solution is to treat certain tables as MySQL system tables, like
we already do for mysql.proc.  Such tables may be opened for reading
at any moment regardless of any locks in effect.  The cost of this is
that system table may be locked for writing only together with other
system tables, it is disallowed to lock system tables for writing and
have any other lock on any other table.

After this patch the following tables are treated as MySQL system
tables:
  mysql.help_category
  mysql.help_keyword
  mysql.help_relation
  mysql.help_topic
  mysql.proc (it already was)
  mysql.time_zone
  mysql.time_zone_leap_second
  mysql.time_zone_name
  mysql.time_zone_transition
  mysql.time_zone_transition_type

These tables are now opened with open_system_tables_for_read() and
closed with close_system_tables(), or one table may be opened with
open_system_table_for_update() and closed with close_thread_tables()
(the latter is used for mysql.proc table, which is updated as part of
normal MySQL server operation).  These functions may be used when
some tables were opened and locked already.

NOTE: online update of time zone tables is not possible during
replication, because there's no time zone cache flush neither on LOCK
TABLES, nor on FLUSH TABLES, so the master may serve stale time zone
data from cache, while on slave updated data will be loaded from the
time zone tables.
2007-03-09 13:12:31 +03:00
anozdrin/alik@booka.opbmk
c666e2f276 Polishing: use constants instead of magic numbers. 2007-03-09 08:05:08 +03:00
mats@romeo.(none)
c815ce1aeb Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/b22583-mysql-5.1-new-rpl
2007-03-07 12:22:10 +01:00
mats@romeo.(none)
844131937f BUG#22583 (RBR between MyISAM and non-MyISAM tables does not work):
Post-merge fixes.
2007-03-07 11:54:32 +01:00
kostja@bodhi.local
ae97896111 Merge bodhi.local:/opt/local/work/mysql-5.0-26750
into  bodhi.local:/opt/local/work/mysql-5.1-runtime
2007-03-07 13:02:14 +03:00
kostja@bodhi.local
86f02cd378 A fix for Bug#26750 "valgrind leak in sp_head" (and post-review
fixes).

The legend: on a replication slave, in case a trigger creation
was filtered out because of application of replicate-do-table/
replicate-ignore-table rule, the parsed definition of a trigger was not 
cleaned up properly. LEX::sphead member was left around and leaked 
memory. Until the actual implementation of support of 
replicate-ignore-table rules for triggers by the patch for Bug 24478 it 
was never the case that "case SQLCOM_CREATE_TRIGGER"
was not executed once a trigger was parsed,
so the deletion of lex->sphead there worked and the memory did not leak.

The fix: 

The real cause of the bug is that there is no 1 or 2 places where
we can clean up the main LEX after parse. And the reason we 
can not have just one or two places where we clean up the LEX is
asymmetric behaviour of MYSQLparse in case of success or error. 

One of the root causes of this behaviour is the code in Item::Item()
constructor. There, a newly created item adds itself to THD::free_list
- a single-linked list of Items used in a statement. Yuck. This code
is unaware that we may have more than one statement active at a time,
and always assumes that the free_list of the current statement is
located in THD::free_list. One day we need to be able to explicitly
allocate an item in a given Query_arena.
Thus, when parsing a definition of a stored procedure, like
CREATE PROCEDURE p1() BEGIN SELECT a FROM t1; SELECT b FROM t1; END;
we actually need to reset THD::mem_root, THD::free_list and THD::lex
to parse the nested procedure statement (SELECT *).
The actual reset and restore is implemented in semantic actions
attached to sp_proc_stmt grammar rule.
The problem is that in case of a parsing error inside a nested statement
Bison generated parser would abort immediately, without executing the
restore part of the semantic action. This would leave THD in an 
in-the-middle-of-parsing state.
This is why we couldn't have had a single place where we clean up the LEX
after MYSQLparse - in case of an error we needed to do a clean up
immediately, in case of success a clean up could have been delayed.
This left the door open for a memory leak.

One of the following possibilities were considered when working on a fix:
- patch the replication logic to do the clean up. Rejected
as breaks module borders, replication code should not need to know the
gory details of clean up procedure after CREATE TRIGGER.
- wrap MYSQLparse with a function that would do a clean up.
Rejected as ideally we should fix the problem when it happens, not
adjust for it outside of the problematic code.
- make sure MYSQLparse cleans up after itself by invoking the clean up
functionality in the appropriate places before return. Implemented in 
this patch.
- use %destructor rule for sp_proc_stmt to restore THD - cleaner
than the prevoius approach, but rejected
because needs a careful analysis of the side effects, and this patch is 
for 5.0, and long term we need to use the next alternative anyway
- make sure that sp_proc_stmt doesn't juggle with THD - this is a 
large work that will affect many modules.

Cleanup: move main_lex and main_mem_root from Statement to its
only two descendants Prepared_statement and THD. This ensures that
when a Statement instance was created for purposes of statement backup,
we do not involve LEX constructor/destructor, which is fairly expensive.
In order to track that the transformation produces equivalent 
functionality please check the respective constructors and destructors
of Statement, Prepared_statement and THD - these members were
used only there.
This cleanup is unrelated to the patch.
2007-03-07 12:24:46 +03:00
bar@mysql.com
8bbb520891 After merge fix 2007-03-01 18:16:17 +04:00
bar@mysql.com
20d2f414c5 Merge mysql.com:/home/bar/mysql-5.0.merge
into  mysql.com:/home/bar/mysql-5.1-rpl
2007-03-01 16:06:29 +04:00
bar@mysql.com
7e38927a38 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  mysql.com:/home/bar/mysql-5.0.b15126
2007-02-28 17:17:06 +04:00
bar@mysql.com
dd0c43d5fa Bug#15126 character_set_database is not replicated (LOAD DATA INFILE need it)
This patch fixes problem that LOAD DATA could use different
character sets when loading files on master and on slave sides:
- Adding replication of thd->variables.collation_database
- Adding optional character set clause into LOAD DATA

Note, the second way, with explicit CHARACTER SET clause
should be the recommended way to load data using an alternative
character set.
The old way, using "SET @@character_set_database=xxx" should be
gradually depricated.
2007-02-28 17:06:57 +04:00
cmiller@zippy.cornsilk.net
06e3f77901 Merge mysqldev@production.mysql.com:my/build-200702201448-5.0.36/mysql-5.0-release/
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
2007-02-27 17:07:08 -05:00
mats@romeo.(none)
75be2a8b65 Eliminating compiler warnings in the sql/ directory. 2007-02-26 18:05:08 +01:00
mats@romeo.(none)
62f8230938 BUG#26634 (Valgrind failure in tree: memory loss for memory allocated in rpl_utility.h):
Adding code to release allocated memory when tables_to_lock list is
cleared.
2007-02-26 17:44:55 +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
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
mats@romeo.(none)
57e0bb85e6 Fixes to make it compile on Windows. 2007-02-24 19:51:45 +01:00
mats@romeo.(none)
279e2b8f6b Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/b26286-mysql-5.1-rpl
2007-02-24 15:26:36 +01:00
mats@romeo.(none)
03a7a2dd01 BUG#26286 (row-based logging scales worse than statement-based logging):
Submitting patch on Guilhem's behalf (he found the solution).
  
Correcting a typo that caused very big increases in memory usage when
more memory needed to be allocated for row-based events. Also correcting
a border case check when more memory needed to be allocated.
2007-02-24 14:33:45 +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
gbichot@dl145h.mysql.com
ba2452f092 Fix for BUG#25628: "mysqlbinlog crashes while processing binary logs".
mysqlbinlog prints all row-based events of a single statement as a
single "BINLOG" statement containing the concatenation of those events.
Big (i.e. >64k) concatenations of row-based events
(e.g. Write_rows_log_event) caused mysqlbinlog's IO_CACHE to overflow
to a temporary file but the IO_CACHE had not been inited with
open_cached_file(), so it tried to create a temporary file in
an uninitialized directory (thus failing to create, then to write;
some OS errors were printed, and it finally segfaulted).
After fixing this, it appeared that mysqlbinlog was printing only
a piece of big concatenations of row-based events (it printed
at most the size of the IO_CACHE's buffer i.e. 64k); that caused data
loss at restore. We fix and test that.
Last, mysqlbinlog's printouts looked a bit strange with the informative
header (#-prefixed) of groupped Rows_log_event all on one line,
so we insert \n. After that, a small bug in the --hexdump code appeared
(only if the string to hex-print had its length a multiple of 16),
we fix it.
2007-02-23 22:23:54 +01: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
cmiller@zippy.cornsilk.net
6e096ee8d9 Prevent bugs by making DBUG_* expressions syntactically equivalent
to a single statement.
---
Bug#24795: SHOW PROFILE

Profiling is only partially functional on some architectures.  Where 
there is no getrusage() system call, presently Null values are 
returned where it would be required.  Notably, Windows needs some love 
applied to make it as useful.

  Syntax this adds:
  
  SHOW PROFILES
  
  SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]
   where "n" is an integer
   and "types" is zero or many (comma-separated) of
      "CPU"
      "MEMORY" (not presently supported)
      "BLOCK IO"
      "CONTEXT SWITCHES"
      "PAGE FAULTS"
      "IPC"
      "SWAPS"
      "SOURCE"
      "ALL"

It also adds a session variable (boolean) "profiling", set to "no"
by default, and (integer) profiling_history_size, set to 15 by 
default.

This patch abstracts setting THDs' "proc_info" behind a macro that 
can be used as a hook into the profiling code when profiling 
support is compiled in.  All future code in this line should use
that mechanism for setting thd->proc_info.

---

Tests are now set to omit the statistics.

---

Adds an Information_schema table, "profiling" for access to 
"show profile" data.
---
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community-3--bug24795
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
---
Fix merge problems.
---
Fixed one bug in the query_source being NULL.  

Updated test results.
---
Include more thorough profiling tests.

Improve support for prepared statements.

Use session-specific query IDs, starting at zero.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.

Limit the size of captured query text.

No longer log queries that are zero length.
2007-02-22 10:03:08 -05:00
mats@romeo.(none)
3306196a7a Merging with mysql-5.1-new-rpl 2007-02-21 13:52:42 +01: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
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
mats@romeo.(none)
e61a1841a5 BUG#22583 (RBR between MyISAM and non-MyISAM tables containing BIT field
does not work): Changing packed row format to only include null bits
for those columns that are present in the row as well as writing BIT
columns in a storage engine-independent format.

The change in row format is incompatible with the previous format and a
slave will not be able to read the new events.
2007-02-12 16:46:42 +01:00
guilhem@gbichot3.local
b3a03dada9 Fix for BUG#24432
"INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values".
When in an INSERT ON DUPLICATE KEY UPDATE, using
an autoincrement column, we inserted some autogenerated values and
also updated some rows, some autogenerated values were not used
(for example, even if 10 was the largest autoinc value in the table
at the start of the statement, 12 could be the first autogenerated
value inserted by the statement, instead of 11). One autogenerated
value was lost per updated row. Led to exhausting the range of the
autoincrement column faster.
Bug introduced by fix of BUG#20188; present since 5.0.24 and 5.1.12.
This bug breaks replication from a pre-5.0.24 master.
But the present bugfix, as it makes INSERT ON DUP KEY UPDATE
behave like pre-5.0.24, breaks replication from a [5.0.24,5.0.34]
master to a fixed (5.0.36) slave! To warn users against this when
they upgrade their slave, as agreed with the support team, we add
code for a fixed slave to detect that it is connected to a buggy
master in a situation (INSERT ON DUP KEY UPDATE into autoinc column)
likely to break replication, in which case it cannot replicate so
stops and prints a message to the slave's error log and to SHOW SLAVE
STATUS.
For 5.0.36->[5.0.24,5.0.34] replication we cannot warn as master
does not know the slave's version (but we always recommended to users
to have slave at least as new as master).
As agreed with support, I'll also ask for an alert to be put into
the MySQL Network Monitoring and Advisory Service.
2007-02-08 15:53:14 +01:00
tomas@poseidon.mysql.com
3c265e5944 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1
into  poseidon.mysql.com:/home/tomas/mysql-5.1-new-ndb
2007-02-05 12:19:24 +07:00
lzhou/zhl@dev3-63.(none)
224900565c Merge dev3-63.(none):/home/zhl/mysql/tree-merge/5.1/mysql-5.1-new-ndb-bj
into  dev3-63.(none):/home/zhl/mysql/tree-merge/5.1/mysql-5.1-new-ndb
2007-02-01 17:34:20 +00: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
monty@narttu.mysql.fi
8a80e36ac3 Merge mysql.com:/home/my/mysql-5.0
into  mysql.com:/home/my/mysql-5.1
Merge of 'remove compiler warnings when using -Wshadow'
2007-01-27 03:46:45 +02:00
mats@romeo.(none)
6bd7fcb62d Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/b19033-mysql-5.1-new-rpl
2007-01-26 20:56:49 +01:00
mats@romeo.(none)
59ada15718 BUG#19033 (RBR: slave does not handle schema changes correctly):
Since checking table compatibility before locking the table, there were
potential that a table could be locked that did not have a definition
that was compatible with the table on the slave.

This patch adds a check just after the table was locked to ensure that
the table is (still) compatible with the table on the slave.
2007-01-26 19:29:57 +01:00
monty@mysql.com/narttu.mysql.fi
a04157fbb3 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2007-01-22 14:04:40 +02:00
tsmith@siva.hindu.god
6b729ff2cd Merge siva.hindu.god:/home/tsmith/m/bk/mrg-jan17/51
into  siva.hindu.god:/home/tsmith/m/bk/mrg-jan17/maint/51
2007-01-18 10:30:39 -07:00
lars/lthalmann@dl145k.mysql.com
74f748999b Merge mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.1-merge
2007-01-17 19:48:35 +01:00
mats@romeo.(none)
3920f529ea BUG#23171 (Illegal slave restart position):
Third patch of the bug fix where the code for skipping events and for
executing events is factored out into three functions:
- shall_skip() to decide if the event shall be skipped and the
  reason for it;
- do_apply_event(), where the event is applied to the database; and
- do_update_pos(), which updates the actual relay log position and
  group positions.
2007-01-17 15:06:37 +01:00
lars/lthalmann@dl145j.mysql.com
1e356251a0 Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.1-new-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.1-merge
2007-01-12 12:31:44 +01:00
lars/lthalmann@mysql.com/dl145j.mysql.com
c380de50ef Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge
2007-01-12 12:22:54 +01:00
cbell/Chuck@suse.vabb.com
183c675980 BUG#22645 - LC_TIME_NAMES: Statement not replicated
This patch is an additional code change to the get_str_len_and_pointer
method in log_events.cc. This change is necessary to correct a problem
encountered on 64-bit SUSE where the auto_increment_* variables were
being overwritten. The change corrects a cast mismatch which caused
the problem.
2007-01-10 13:45:41 -05:00
cbell/Chuck@suse.vabb.com
20036a42b8 BUG#22645 - LC_TIME_NAMES: Statement not replicated
This patch is an additional code change to the get_str_len_and_pointer 
method in log_events.cc. This change is necessary to correct a problem
encountered on 64-bit SUSE where the auto_increment_* variables were
being overwritten. The change corrects a cast mismatch which caused
the problem.
2007-01-10 12:20:13 -05:00
cmiller@zippy.cornsilk.net
68428545a5 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-community
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
2007-01-03 18:24:28 -05:00
cmiller@zippy.cornsilk.net
10cdf90bd3 Bug#24795: Add SHOW PROFILE
Patch contributed by Jeremy Cole.  CLA received Oct 2006 by Kaj Arnö

Add rudimentary query profiling support.
2007-01-03 17:15:10 -05:00
bar@mysql.com
8f3718848d After merge fix 2006-12-29 16:45:10 +04:00
bar@mysql.com
2c039cccb6 log_event.cc:
After merge fix
2006-12-29 16:42:16 +04:00
tsmith/tim@siva.hindu.god
0cb9cee7f4 Merge siva.hindu.god:/usr/home/tim/m/bk/g51
into  siva.hindu.god:/usr/home/tim/m/bk/tmp/mrg51-dec26
2006-12-26 16:49:10 -07:00
kent@kent-amd64.(none)
be15e3bc15 Merge mysql.com:/home/kent/bk/main/mysql-5.0
into  mysql.com:/home/kent/bk/main/mysql-5.1
2006-12-23 20:20:40 +01:00
kent@mysql.com/kent-amd64.(none)
226a5c833f Many files:
Changed header to GPL version 2 only
2006-12-23 20:17:15 +01:00
patg@radha.patg.net
efefea6a5e WL #3031
* Various windows errors fixed
* Increased max key length for federated
2006-12-21 22:38:54 -05:00
dli@dev3-164.dev.cn.tlan
e9fcb1e310 Merge dli@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb-bj
into  dev3-164.dev.cn.tlan:/home/dli/mysql/mysql-5.1/mysql-5.1-bug-19896
2006-12-22 10:08:11 +08:00
dli@dev3-164.dev.cn.tlan
fcb0e53b75 ndb - fixed for BUG#19896 Last_Errno: 4294967295, Error in Write_rows event: (error number 4 billion ?)
fixed to use int instead of uint32 type to return last_slave_errno.
2006-12-22 09:59:27 +08:00
msvensson@shellback.
fe341ad904 Add macro for retrieving sec part of "struct timespec"
Use macros for working with "struct timespec" in event_queue.cc
Fix merge problem
2006-12-15 10:41:24 +01:00
monty@mysql.com/narttu.mysql.fi
88dd873de0 Fixed compiler warnings detected by option -Wshadow and -Wunused:
- Removed not used variables and functions
- Added #ifdef around code that is not used
- Renamed variables and functions to avoid conflicts
- Removed some not used arguments

Fixed some class/struct warnings in ndb
Added define IS_LONGDATA() to simplify code in libmysql.c

I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes
2006-12-15 00:51:37 +02:00
bar@mysql.com/bar.myoffice.izhnet.ru
4722743cae After merge fix for Bug N22645 2006-12-14 17:48:32 +04:00
bar@bar.intranet.mysql.r18.ru
f29b2bea7a Merge mysql.com:/usr/home/bar/mysql-5.0.b22645
into  mysql.com:/usr/home/bar/mysql-5.1.b22645
2006-12-14 16:45:48 +04:00
bar@mysql.com/bar.intranet.mysql.r18.ru
cfdec2ca1e After merge fix for bug N22645 2006-12-14 16:31:23 +04:00
bar@mysql.com/bar.intranet.mysql.r18.ru
cedafa8dec Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  mysql.com:/usr/home/bar/mysql-5.0.b22645
2006-12-14 14:19:30 +04:00
mats@romeo.(none)
600dc1813d Merging with mysql-5.1-new-rpl 2006-12-11 12:22:21 +01:00
lars@black.(none)
d85ca0dc1d Merge mysql.com:/home/bkroot/mysql-5.1-new-rpl
into  mysql.com:/home/bk/MERGE/mysql-5.1-merge
2006-12-08 23:41:29 +01:00
rafal@quant.(none)
fe2d5c59c2 Merge quant.(none):/ext/mysql/bkroot/mysql-5.0-rpl
into  quant.(none):/ext/mysql/bk/mysql-5.0-bug24507
2006-12-08 11:47:48 +01:00
bar@bar.intranet.mysql.r18.ru
864ad7daa0 After merge fix 2006-12-08 10:33:05 +04:00
cbell/Chuck@suse.vabb.com
9f36c1c286 WL#3618 - Remove HAVE_ROW_BASED_REPLICATION from source code.
Please see worklog for details on files changed.
2006-12-07 09:18:35 -05:00
bar@mysql.com/bar.intranet.mysql.r18.ru
b66f34bd19 Bug#22645 LC_TIME_NAMES: Statement not replicated
Implementing event based replication of LC_TIME_NAMES for 5.0
(as a replacement of previously made ONE_SHOT replication)
2006-12-07 09:31:53 +04:00
mats@romeo.(none)
033516c571 BUG#24490 (segfault inside unpack_row at Field_bit_as_char::set_default()):
Field_bit::set_default() did not check the bit_len, hence used the undefined
bit_ptr, causing a crash. The patch adds a check that bit_len > 0 before
following the bit_ptr.
2006-12-05 10:46:03 +01:00
baker@bk-internal.mysql.com
dbe5f0acc5 Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into  bk-internal.mysql.com:/data0/bk/mysql-5.1-arch
2006-12-03 21:19:35 +01:00
brian@zim.(none)
31d67280f7 This finishes the work (someone) started to remove FIELD_ types and use the Enum MYSQL types. The second part to this is to actually deprecate the FIELD defines in mysql_com.h 2006-12-01 17:26:52 -08:00
monty@mysql.com/narttu.mysql.fi
3a35c30027 Fixed compiler warnings (Mostly VC++):
- Removed not used variables
- Changed some ulong parameters/variables to ulonglong (possible serious bug)
- Added casts to get rid of safe assignment from longlong to long (and similar)
- Added casts to function parameters
- Fixed signed/unsigned compares
- Added some constructores to structures
- Removed some not portable constructs

Better fix for bug Bug #21428 "skipped 9 bytes from file: socket (3)" on "mysqladmin shutdown"
(Added new parameter to net_clear() to define when we want the communication buffer to be emptied)
2006-11-30 03:40:42 +02:00
bar@mysql.com/bar.intranet.mysql.r18.ru
a70028a855 Bug#20396 Bin Log does not get DELIMETER cmd - Recover StoredProc fails
Problem: when loading mysqlbinlog dumps, CREATE PROCEDURE having semicolons
in their bodies failed.
Fix: Using safe delimiter "/*!*/;" to dump log entries.
2006-11-28 16:26:15 +04:00
monty@mysql.com/nosik.monty.fi
0e149b7170 Removed compiler warnings
Ensure that my_size_t is always unsigned (to get predictiable results from system to system)
Removed some %lld, as these are not portable
2006-11-27 18:16:08 +02:00
monty@nosik.monty.fi
313f23a93a Merge bk-internal.mysql.com:/home/bk/mysql-5.1-marvel
into  mysql.com:/home/my/mysql-5.1
2006-11-27 14:07:52 +02:00
monty@mysql.com/nosik.monty.fi
fa81a82e7f Fixed a LOT of compiler warnings
Added missing DBUG_RETURN statements (in mysqldump.c)
Added missing enums
Fixed a lot of wrong DBUG_PRINT() statements, some of which could cause crashes
Removed usage of %lld and %p in printf strings as these are not portable or produces different results on different systems.
2006-11-27 01:47:38 +02:00
mats@romeo.(none)
6b57021683 BUG#24533 (uninitialized null bits in m_after_image):
Removing valgrind memory checks from code.
2006-11-23 10:43:43 +01:00
mats@romeo.(none)
f827f734c8 BUG#24533 (uninitialized null but of m_after_image):
Patch to fix valgrind warning that uninitialized bytes were written. 
The warning was caused by set_default(), which assumes that the field pointer is pointing
into record[0], while all other functions honors the move_field_offset().
2006-11-23 10:15:02 +01:00
monty@nosik.monty.fi
89570bf966 Merge mysql.com:/home/my/mysql-5.0
into  mysql.com:/home/my/mysql-5.1
2006-11-22 14:11:36 +02:00
lars@black.(none)
6a85cca986 Merge mysql.com:/home/bkroot/mysql-5.1-new-rpl
into  mysql.com:/home/bk/MERGE/mysql-5.1-merge
2006-11-22 02:24:16 +01:00
mats@romeo.(none)
600a6a676c BUG#24403 (valgrind complaint on uninited st_table for innodb + rbr):
Removing DBUG_DUMP printouts for valgrind builds since they trigger warnings.
Removing valgrind memory checks completely.
Removing bzero() of record when opening table that was added earlier.
2006-11-21 13:57:52 +01:00
monty@mysql.com/nosik.monty.fi
306b871d52 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2006-11-20 22:46:52 +02:00
monty@mysql.com/nosik.monty.fi
e825879800 Remove compiler warnings
(Mostly in DBUG_PRINT() and unused arguments)
Fixed bug in query cache when used with traceing (--with-debug)
Fixed memory leak in mysqldump
Removed warnings from mysqltest scripts (replaced -- with #)
2006-11-20 22:42:06 +02:00
mats@romeo.(none)
3eabde4091 BUG#24403 (valgrind complained on uninited st_table for InnoDB and RBR):
Fix to correct behaviour of find_and_fetch_row() for tables that have primary keys stored
in storage engines that support the fast method to fetch rows given a primary key. The
method uses position() to retrieve the key for a given record and rnd_pos() to position
the internal "cursor" at the row. Rnd_pos() returns the found record in table->record[0],
so the record has to be moved to table->record[1] for further processing after calling
find_and_fetch_row().
2006-11-20 21:27:39 +01:00
bar@bar.intranet.mysql.r18.ru
8c369a4700 Merge mysql.com:/usr/home/bar/mysql-5.0.b23619
into  mysql.com:/usr/home/bar/mysql-5.1.b23619
2006-11-16 12:51:49 +04:00
bar@mysql.com/bar.intranet.mysql.r18.ru
d3603eb152 Merge mysql.com:/usr/home/bar/mysql-5.0-rpl
into  mysql.com:/usr/home/bar/mysql-5.0.b23619
2006-11-16 12:28:09 +04:00
aelkin/elkin@dsl-hkibras-fe30f900-107.dhcp.inet.fi
a7c31fa761 Merge dsl-hkibras-fe30f900-107.dhcp.inet.fi:/home/elkin/MySQL/TEAM/BARE/5.0
into  dsl-hkibras-fe30f900-107.dhcp.inet.fi:/home/elkin/MySQL/TEAM/FIXES/merge_50_1
2006-11-14 13:04:40 +02:00
aelkin/elkin@dsl-hkibras-fe30f900-107.dhcp.inet.fi
650a245568 bug#19402 SQL close to the size of the max_allowed_packet fails on the slave
ver 5.0 and 5.1 refinement.
adding to the MAX_SIZE_LOG_EVENT_STATUS estimation status vars and 
EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN
2006-11-14 12:48:17 +02:00
aelkin/elkin@dsl-hkibras-fe30f900-107.dhcp.inet.fi
7b0eb936d1 Merge aelkin@bk-internal.mysql.com:/home/bk/mysql-5.1-rpl
into  dsl-hkibras-fe30f900-107.dhcp.inet.fi:/home/elkin/MySQL/TEAM/FIXES/merge_50
2006-11-13 12:45:47 +02:00
mats@romeo.(none)
1fb9105ebd BUG#23171 (Illegal slave restart group position):
Second patch to fix skipping code. Moving relay and binary log 
position changing code from do_apply_event [old exec_event()] into
do_update_pos() and doing other changes necessary to support that.

Fixing a bug that can cause deadlock if rotating binary log when committing
a changes to a transactional table that is not inside a transaction and
cause a rotate log.
2006-11-10 15:10:41 +01:00
bar@mysql.com/bar.intranet.mysql.r18.ru
a5de478d51 Bug#23619 Incorrectly escaped multibyte characters in binary log break replication
Problem: when embedding a character string with introducer with charset X
into a SQL query which is generally in character set Y, the string constants
were escaped according to their own character set (i.e.X), then after reading
such a "mixed" query from binlog, the string constants were unescaped
using character set of the query (i.e. Y), instead of X, which gave wrong
results or even syntax errors with tricky charsets (e.g. sjis)
Fix: when embedding a string constant of charset X into a query of charset Y,
the string constant is now escaped according to character Y, instead of
its own character set X.
2006-11-09 14:27:34 +04:00
lars/lthalmann@dl145h.mysql.com
3776e9622b Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new-rpl
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.1-merge
2006-11-07 19:26:31 +01:00
mats@romeo.(none)
edb7045353 Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/b23171-mysql-5.1-new-rpl
2006-11-04 21:10:01 +01:00
mats@romeo.(none)
efaa0f4092 Post-merge fixes. 2006-11-03 21:55:51 +01:00
mats@romeo.(none)
a726fec6e7 Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/b18581-mysql-5.1-new-rpl
2006-11-03 21:11:58 +01:00
aelkin/elkin@dsl-hkigw8-feaef900-46.dhcp.inet.fi
8823b832bb Bug#16228/Bug#20697 - related.
Bug#23831  deadlock not noticed

RBR bug in that when replicated msta (multi-statement-trans-action) deadlocks
with a local at write row event or gets timed-out, the event handler did not return
the correct error code.
Wrong error code stops slave sql thread instead of to proceed with
rollback and replay.

The correct code is typed in error log and stored for error handling rotine
to conduct rollback and replay of the transaction. The handling for the rbr
remains the same as for the sbr events.
Particularly, timed-out transaction still is rolled back - look at the related bugs.
2006-11-03 14:26:40 +02:00
cbell/Chuck@mysql_cab.
367a41c308 Changes to the code are necessary to compile on Windows. Typecasts are needed in several DBUG_DUMP statements. CAB 01 Nov 2006 2006-11-01 11:52:32 -05:00
mats@romeo.(none)
9372c38c6b BUG#23171 (Illegal slave restart group position):
First patch preparing for restructuring the event execution and event
skipping. This patch renames the existing (virtual) function exec_event()
to be a primitive for implementing the real patch. Also, the virtual function
advance_coord_impl() is added to advance the binary/relay log coordinates,
and two non-virtual functions exec_event() [sic] and skip_event() is added
that will contain the business logic for executing and skipping events
respectively.
2006-11-01 15:35:37 +01:00
mats@romeo.(none)
83f8e17258 BUG#18581 (Creation of system tables recorded in binlog causing slave failure):
Not replicating the mysql database *at all* any more. All changes to
mysql tables are replicated by replicating the statements that do
the changes.
2006-11-01 09:49:03 +01:00
kent@mysql.com/c-584072d5.010-2112-6f72651.cust.bredbandsbolaget.se
f0bb52ab13 log_event.cc, sql_class.cc:
VisualStudio needs cast from (byte*) to (const char*), 3rd arg to _db_dump_()
2006-10-13 03:32:38 +02:00
mats@romeo.(none)
1023aecb1c Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/b21474-mysql-5.1-new-rpl
2006-10-10 15:26:02 +02:00
mats@romeo.(none)
6c3b1f6eb0 BUG#21474 (There is a rotation before the last table map):
Removing code to step the group log position and just stepping
the event log position.  If the group log position were stepped
one time too many, it might be that the group starts at a position
that is not possible, e.g., at a Rows_log_event, or between an
Intvar_log_event and the following associated Query_log_event.
2006-10-10 15:18:21 +02:00
mats@romeo.(none)
799585c5ac Fixes to make replication team tree build on Windows. 2006-10-10 14:58:40 +02:00
mats@romeo.(none)
d4d26ba7d5 Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/b19459-mysql-5.1-new
2006-10-06 15:31:05 +02:00
mats@romeo.(none)
e762328b54 BUG#19459 (BINLOG RBR command does not lock tables correctly causing
crash for, e.g., NDB):

Before, mysqlbinlog printed table map events as a separate statement, so
when executing the event, the opened table was subsequently closed
when the statement ended. Instead, the row-based events that make up
a statement are now printed as *one* BINLOG statement, which means
that the table maps and the following *_rows_log_event events are
executed fully before the statement ends.

Changing implementation of BINLOG statement to be able to read the 
emitted format, which now consists of several chunks of BASE64-encoded
data.
2006-10-06 10:17:02 +02:00
kroki/tomash@moonlight.intranet
5ea8adfae7 BUG#21726: Incorrect result with multiple invocations of LAST_INSERT_ID
Non-upper-level INSERTs (the ones in the body of stored procedure,
stored function, or trigger) into a table that have AUTO_INCREMENT
column didn't affected the result of LAST_INSERT_ID() on this level.

The problem was introduced with the fix of bug 6880, which in turn was
introduced with the fix of bug 3117, where current insert_id value was
remembered on the first call to LAST_INSERT_ID() (bug 3117) and was
returned from that function until it was reset before the next
_upper-level_ statement (bug 6880).

The fix for bug#21726 brings back the behaviour of version 4.0, and
implements the following: remember insert_id value at the beginning
of the statement or expression (which at that point equals to
the first insert_id value generated by the previous statement), and
return that remembered value from LAST_INSERT_ID() or @@LAST_INSERT_ID.

Thus, the value returned by LAST_INSERT_ID() is not affected by values
generated by current statement, nor by LAST_INSERT_ID(expr) calls in
this statement.

Version 5.1 does not have this bug (it was fixed by WL 3146).
2006-10-02 14:28:23 +04:00
mats@romeo.(none)
3b9b6e6544 Merge mkindahl@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl
into  romeo.(none):/home/bkroot/mysql-5.1-new-rpl
2006-09-21 18:11:35 +02:00
mats@romeo.(none)
f5b8614fc7 BUG#22550 (Replication of BIT column failing):
Using move_field_offset() to move field pointer to other record before
calling pack()/unpack().
2006-09-21 18:05:02 +02:00
lars/lthalmann@dl145j.mysql.com
57a74ea4af Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new-rpl
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.1-merge
2006-09-21 00:23:20 +02:00
kaa@polly.local
46f2a4dbc6 Fixed the faulty merge 2006-09-13 21:25:33 +04:00
mats@romeo.(none)
ca50d070a0 WL#3259 (RBR with more columns on slave than master):
Incorporating changes from review.
Fixing one bug that surfaced.
2006-09-13 19:25:12 +02:00
kaa@polly.local
b9811a6df1 Fixed the faulty merge 2006-09-13 19:32:21 +04:00
kaa@polly.local
61e3f8eae1 Merge polly.local:/tmp/20924/bug20294/my50-bug20294
into  polly.local:/tmp/20924/bug20294/my51-bug20294
2006-09-13 16:00:15 +04:00
kaa@polly.local
e812ae873d Merge polly.local:/tmp/20924/bug20294/my41-bug20294
into  polly.local:/tmp/20924/bug20294/my50-bug20294
2006-09-13 15:18:14 +04:00
kaa@polly.local
397f0df9ad Cset exclude: kaa@polly.local|ChangeSet|20060912122540|09861
Cset exclude: kaa@polly.local|ChangeSet|20060908100829|09983
2006-09-13 14:41:28 +04:00
kaa@polly.local
ca48b7af0c Merge polly.local:/tmp/20924/bug20294/my50-bug20294
into  polly.local:/tmp/20924/bug20294/my51-bug20294
2006-09-12 18:43:38 +04:00
kaa@polly.local
e03faff3e4 Merge polly.local:/tmp/20924/bug20294/my41-bug20294
into  polly.local:/tmp/20924/bug20294/my50-bug20294
2006-09-12 17:57:15 +04:00
kaa@polly.local
5df7611caa Post-review fixes for bug #20924 2006-09-12 16:25:40 +04:00
mats@romeo.(none)
26c831f75d Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/w3259-mysql-5.1-new-rpl
2006-09-08 11:41:19 +02:00
mats@romeo.(none)
090e020921 Patches to fix problems on Windows 2006-09-08 10:20:14 +02:00
mats@romeo.(none)
eea3e3d6b1 Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/b17620-mysql-5.1-new-rpl
2006-09-06 19:34:02 +02:00
mats@romeo.(none)
6ba388d17c BUG#17620: Row-based replication fails when query cache enabled on slave
Invalidating query cache when processing rows for a statement on the slave.
2006-09-06 17:45:27 +02:00
mats@romeo.(none)
dbc98766b0 WL#3259 (RBR with more columns on slave than on master):
Post-merge fixes.
2006-08-22 10:36:11 +02:00
mats@romeo.(none)
c2d7f7c392 Merge romeo.(none):/home/bkroot/mysql-5.1-wl3228
into  romeo.(none):/home/bk/w3259-mysql-5.1-new-rpl
2006-08-21 10:54:41 +02:00
kostja@bodhi.local
a38b418436 Post-merge fixes. 2006-07-13 17:34:49 +04:00
kostja@bodhi.local
99fefab169 Merge bodhi.local:/opt/local/work/tmp_merge
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge-5.0
2006-07-13 11:43:52 +04:00
kostja@bodhi.local
56353959e7 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
2006-07-13 00:18:59 +04:00
mkindahl@dl145k.mysql.com
9415b24139 Merge dl145k.mysql.com:/data0/mkindahl/bkroot/mysql-5.1-new-rpl
into  dl145k.mysql.com:/data0/mkindahl/bk/MERGE/mysql-5.1-merge
2006-07-11 12:17:19 +02:00
guilhem@gbichot3.local
1cc3c80070 fixes after merge. Updates to test's results.
We now reset the THD members related to auto_increment+binlog in
MYSQL_LOG::write(). This is better than in THD::cleanup_after_query(),
which was not able to distinguish between SELECT myfunc1(),myfunc2()
and INSERT INTO t SELECT myfunc1(),myfunc2() from a binlogging point
of view.
Rows_log_event::exec_event() now calls lex_start() instead of
mysql_init_query() because the latter now does too much (it resets
the binlog format).
2006-07-10 18:41:03 +02:00
guilhem@gbichot3.local
bca3fc7800 Merge gbichot3.local:/home/mysql_src/mysql-5.1-interval-move-next-insert-id
into  gbichot3.local:/home/mysql_src/mysql-5.1
2006-07-09 22:50:02 +02:00
guilhem@gbichot3.local
0594e1b84b WL#3146 "less locking in auto_increment":
this is a cleanup patch for our current auto_increment handling:
new names for auto_increment variables in THD, new methods to manipulate them
(see sql_class.h), some move into handler::, causing less backup/restore
work when executing substatements. 
This makes the logic hopefully clearer, less work is is needed in
mysql_insert().
By cleaning up, using different variables for different purposes (instead
of one for 3 things...), we fix those bugs, which someone may want to fix
in 5.0 too:
BUG#20339 "stored procedure using LAST_INSERT_ID() does not replicate
statement-based"
BUG#20341 "stored function inserting into one auto_increment puts bad
data in slave"
BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY UPDATE"
(now if a row is updated, LAST_INSERT_ID() will return its id)
and re-fixes:
BUG#6880 "LAST_INSERT_ID() value changes during multi-row INSERT"
(already fixed differently by Ramil in 4.1)
Test of documented behaviour of mysql_insert_id() (there was no test).
The behaviour changes introduced are:
- LAST_INSERT_ID() now returns "the first autogenerated auto_increment value
successfully inserted", instead of "the first autogenerated auto_increment
value if any row was successfully inserted", see auto_increment.test.
Same for mysql_insert_id(), see mysql_client_test.c.
- LAST_INSERT_ID() returns the id of the updated row if ON DUPLICATE KEY
UPDATE, see auto_increment.test. Same for mysql_insert_id(), see
mysql_client_test.c.
- LAST_INSERT_ID() does not change if no autogenerated value was successfully 
inserted (it used to then be 0), see auto_increment.test.
- if in INSERT SELECT no autogenerated value was successfully inserted,
mysql_insert_id() now returns the id of the last inserted row (it already
did this for INSERT VALUES), see mysql_client_test.c.
- if INSERT SELECT uses LAST_INSERT_ID(X), mysql_insert_id() now returns X
(it already did this for INSERT VALUES), see mysql_client_test.c.
- NDB now behaves like other engines wrt SET INSERT_ID: with INSERT IGNORE,
the id passed in SET INSERT_ID is re-used until a row succeeds; SET INSERT_ID
influences not only the first row now.

Additionally, when unlocking a table we check that the thread is not keeping
a next_insert_id (as the table is unlocked that id is potentially out-of-date);
forgetting about this next_insert_id is done in a new
handler::ha_release_auto_increment().

Finally we prepare for engines capable of reserving finite-length intervals
of auto_increment values: we store such intervals in THD. The next step
(to be done by the replication team in 5.1) is to read those intervals from
THD and actually store them in the statement-based binary log. NDB
will be a good engine to test that.
2006-07-09 17:52:19 +02:00
mats@romeo.(none)
c18b7d191a Fixing usage of my_strndup() to new prototype. 2006-07-07 21:03:19 +02:00
dlenev@jabberwock.site
e4a9f06a8b Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  jabberwock.site:/home/dlenev/mysql-5.1-bg18437
2006-07-07 23:01:28 +04:00
konstantin/kostja@bodhi.local
377e0862ca Fixes for Windows compilation failures. 2006-07-07 16:14:07 +04:00
dlenev@jabberwock.site
77f640b1a3 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  jabberwock.site:/home/dlenev/mysql-5.1-bg18437
2006-07-07 14:11:35 +04:00
konstantin@bodhi.netgear
01bc761690 Merge bodhi.netgear:/opt/local/work/tmp_merge
into  bodhi.netgear:/opt/local/work/mysql-5.1-runtime-merge-with-5.0
2006-07-06 22:55:48 +04:00
dlenev@mysql.com
d6f47c31b6 After merge fixes for patch solving bug#18437 "Wrong values inserted with a
before update trigger on NDB table".

Two main changes:
- We use TABLE::read_set/write_set bitmaps for marking fields used by
  statement instead of Field::query_id in 5.1.
- Now when we mark columns used by statement we take into account columns 
  used by table's triggers instead of marking all columns as used if table
  has triggers.
2006-07-06 13:33:23 +04:00
cmiller@zippy.(none)
6110a83a0e Merge zippy.(none):/home/cmiller/work/mysql/merge/mysql-5.0
into  zippy.(none):/home/cmiller/work/mysql/merge/mysql-5.1
2006-07-03 11:35:58 -04:00
konstantin@mysql.com
55d148c5c2 A fix for Bug#19022 "Memory bug when switching db during trigger execution".
No test case as the bug is in an existing test case (rpl_trigger.test
when it is run under valgrind).
The warning was caused by memory corruption in replication slave: thd->db
was pointing at a stack address that was previously used by 
sp_head::execute()::old_db. This happened because mysql_change_db
behaved differently in replication slave and did not make a copy of the 
argument to assign to thd->db. 
The solution is to always free the old value of thd->db and allocate a new
copy, regardless whether we're running in a replication slave or not.
2006-06-28 23:47:45 +04:00
monty@mysql.com
31fdcd3be0 Added purecov comment for new, not executed code for my recent changeset
(Found by dgcov)
2006-06-28 14:03:08 +03:00
konstantin@mysql.com
3cf181bb64 Fix compilation failures on Windows caused by the patch for Bug#17199.
Fix a minor issue with Bug#16206 (bdb.test failed if the tree is compiled 
without blackhole).
2006-06-27 14:56:24 +04:00
konstantin@mysql.com
4d25d2154c Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mysql.com:/opt/local/work/mysql-5.0-17199
2006-06-27 00:52:56 +04:00
konstantin@mysql.com
117b76a562 A fix and a test case for
Bug#19022 "Memory bug when switching db during trigger execution"
 Bug#17199 "Problem when view calls function from another database."
 Bug#18444 "Fully qualified stored function names don't work correctly in
            SELECT statements"

 Documentation note: this patch introduces a change in behaviour of prepared
 statements.

 This patch adds a few new invariants with regard to how THD::db should
 be used. These invariants should be preserved in future:

  - one should never refer to THD::db by pointer and always make a deep copy
    (strmake, strdup)
  - one should never compare two databases by pointer, but use strncmp or
    my_strncasecmp
  - TABLE_LIST object table->db should be always initialized in the parser or
    by creator of the object.

    For prepared statements it means that if the current database is changed
    after a statement is prepared, the database that was current at prepare
    remains active. This also means that you can not prepare a statement that
    implicitly refers to the current database if the latter is not set.
    This is not documented, and therefore needs documentation. This is NOT a
    change in behavior for almost all SQL statements except:
     - ALTER TABLE t1 RENAME t2 
     - OPTIMIZE TABLE t1
     - ANALYZE TABLE t1
     - TRUNCATE TABLE t1 --
     until this patch t1 or t2 could be evaluated at the first execution of
     prepared statement. 

     CURRENT_DATABASE() still works OK and is evaluated at every execution
     of prepared statement.

     Note, that in stored routines this is not an issue as the default
     database is the database of the stored procedure and "use" statement
     is prohibited in stored routines.

  This patch makes obsolete the use of check_db_used (it was never used in the
  old code too) and all other places that check for table->db and assign it
  from THD::db if it's NULL, except the parser.

 How this patch was created: THD::{db,db_length} were replaced with a
 LEX_STRING, THD::db. All the places that refer to THD::{db,db_length} were
 manually checked and:
  - if the place uses thd->db by pointer, it was fixed to make a deep copy
  - if a place compared two db pointers, it was fixed to compare them by value
    (via strcmp/my_strcasecmp, whatever was approproate)
 Then this intermediate patch was used to write a smaller patch that does the
 same thing but without a rename.

 TODO in 5.1:
   - remove check_db_used
   - deploy THD::set_db in mysql_change_db

 See also comments to individual files.
2006-06-27 00:47:52 +04:00
monty@mysql.com
7ec5a7ecc5 Fixed memory leak (found by rpl_row_inexist_tbl) 2006-06-23 10:35:45 +03:00
monty@mysql.com
b8ab496057 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/my/mysql-5.1
2006-06-22 12:21:41 +03:00
monty@mysql.com
860661a2dc unsigned char -> uchar
Added missing copyright
Indentation and prototype fixes
Fixed compiler warning
2006-06-19 12:45:34 +03:00
lars@mysql.com
5f37fc4a76 Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new-rpl
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.1-merge
2006-06-16 01:15:19 +02:00
cmiller@zippy.(none)
7b63337d31 Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit
mode

This is a modification of serg's and guilhem's suggestion in the bug report,
in that it also causes the transaction log to be written to disc.
2006-06-12 08:54:45 -04:00
aivanov@mysql.com
bd6a289fb4 Fixed BUG#18948 "Disabled test case rpl_row_inexist_tbl".
The bug was caused by ignoring failure when opening a
 a table in Table_map_log_event::exec_event().
2006-06-05 05:49:06 +04:00
monty@mysql.com
c46fb742b8 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  mysql.com:/home/my/mysql-5.1
2006-06-04 21:05:22 +03:00
monty@mysql.com
74cc73d461 This changeset is largely a handler cleanup changeset (WL#3281), but includes fixes and cleanups that was found necessary while testing the handler changes
Changes that requires code changes in other code of other storage engines.
(Note that all changes are very straightforward and one should find all issues
by compiling a --debug build and fixing all compiler errors and all
asserts in field.cc while running the test suite),

- New optional handler function introduced: reset()
  This is called after every DML statement to make it easy for a handler to
  statement specific cleanups.
  (The only case it's not called is if force the file to be closed)

- handler::extra(HA_EXTRA_RESET) is removed. Code that was there before
  should be moved to handler::reset()

- table->read_set contains a bitmap over all columns that are needed
  in the query.  read_row() and similar functions only needs to read these
  columns
- table->write_set contains a bitmap over all columns that will be updated
  in the query. write_row() and update_row() only needs to update these
  columns.
  The above bitmaps should now be up to date in all context
  (including ALTER TABLE, filesort()).

  The handler is informed of any changes to the bitmap after
  fix_fields() by calling the virtual function
  handler::column_bitmaps_signal(). If the handler does caching of
  these bitmaps (instead of using table->read_set, table->write_set),
  it should redo the caching in this code. as the signal() may be sent
  several times, it's probably best to set a variable in the signal
  and redo the caching on read_row() / write_row() if the variable was
  set.

- Removed the read_set and write_set bitmap objects from the handler class

- Removed all column bit handling functions from the handler class.
  (Now one instead uses the normal bitmap functions in my_bitmap.c instead
  of handler dedicated bitmap functions)

- field->query_id is removed. One should instead instead check
  table->read_set and table->write_set if a field is used in the query.

- handler::extra(HA_EXTRA_RETRIVE_ALL_COLS) and
  handler::extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY) are removed. One should now
  instead use table->read_set to check for which columns to retrieve.

- If a handler needs to call Field->val() or Field->store() on columns
  that are not used in the query, one should install a temporary
  all-columns-used map while doing so. For this, we provide the following
  functions:

  my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
  field->val();
  dbug_tmp_restore_column_map(table->read_set, old_map);

  and similar for the write map:

  my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set);
  field->val();
  dbug_tmp_restore_column_map(table->write_set, old_map);

  If this is not done, you will sooner or later hit a DBUG_ASSERT
  in the field store() / val() functions.
  (For not DBUG binaries, the dbug_tmp_restore_column_map() and
  dbug_tmp_restore_column_map() are inline dummy functions and should
  be optimized away be the compiler).

- If one needs to temporary set the column map for all binaries (and not
  just to avoid the DBUG_ASSERT() in the Field::store() / Field::val()
  methods) one should use the functions tmp_use_all_columns() and
  tmp_restore_column_map() instead of the above dbug_ variants.

- All 'status' fields in the handler base class (like records,
  data_file_length etc) are now stored in a 'stats' struct. This makes
  it easier to know what status variables are provided by the base
  handler.  This requires some trivial variable names in the extra()
  function.

- New virtual function handler::records().  This is called to optimize
  COUNT(*) if (handler::table_flags() & HA_HAS_RECORDS()) is true.
  (stats.records is not supposed to be an exact value. It's only has to
  be 'reasonable enough' for the optimizer to be able to choose a good
  optimization path).

- Non virtual handler::init() function added for caching of virtual
  constants from engine.

- Removed has_transactions() virtual method. Now one should instead return
  HA_NO_TRANSACTIONS in table_flags() if the table handler DOES NOT support
  transactions.

- The 'xxxx_create_handler()' function now has a MEM_ROOT_root argument
  that is to be used with 'new handler_name()' to allocate the handler
  in the right area.  The xxxx_create_handler() function is also
  responsible for any initialization of the object before returning.

  For example, one should change:

  static handler *myisam_create_handler(TABLE_SHARE *table)
  {
    return new ha_myisam(table);
  }

  ->

  static handler *myisam_create_handler(TABLE_SHARE *table, MEM_ROOT *mem_root)
  {
    return new (mem_root) ha_myisam(table);
  }

- New optional virtual function: use_hidden_primary_key().
  This is called in case of an update/delete when
  (table_flags() and HA_PRIMARY_KEY_REQUIRED_FOR_DELETE) is defined
  but we don't have a primary key. This allows the handler to take precisions
  in remembering any hidden primary key to able to update/delete any
  found row. The default handler marks all columns to be read.

- handler::table_flags() now returns a ulonglong (to allow for more flags).

- New/changed table_flags()
  - HA_HAS_RECORDS	    Set if ::records() is supported
  - HA_NO_TRANSACTIONS	    Set if engine doesn't support transactions
  - HA_PRIMARY_KEY_REQUIRED_FOR_DELETE
                            Set if we should mark all primary key columns for
			    read when reading rows as part of a DELETE
			    statement. If there is no primary key,
			    all columns are marked for read.
  - HA_PARTIAL_COLUMN_READ  Set if engine will not read all columns in some
			    cases (based on table->read_set)
 - HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS
   			    Renamed to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION.
 - HA_DUPP_POS              Renamed to HA_DUPLICATE_POS
 - HA_REQUIRES_KEY_COLUMNS_FOR_DELETE
			    Set this if we should mark ALL key columns for
			    read when when reading rows as part of a DELETE
			    statement. In case of an update we will mark
			    all keys for read for which key part changed
			    value.
  - HA_STATS_RECORDS_IS_EXACT
			     Set this if stats.records is exact.
			     (This saves us some extra records() calls
			     when optimizing COUNT(*))
			    

- Removed table_flags()
  - HA_NOT_EXACT_COUNT     Now one should instead use HA_HAS_RECORDS if
			   handler::records() gives an exact count() and
			   HA_STATS_RECORDS_IS_EXACT if stats.records is exact.
  - HA_READ_RND_SAME	   Removed (no one supported this one)

- Removed not needed functions ha_retrieve_all_cols() and ha_retrieve_all_pk()

- Renamed handler::dupp_pos to handler::dup_pos

- Removed not used variable handler::sortkey


Upper level handler changes:

- ha_reset() now does some overall checks and calls ::reset()
- ha_table_flags() added. This is a cached version of table_flags(). The
  cache is updated on engine creation time and updated on open.


MySQL level changes (not obvious from the above):

- DBUG_ASSERT() added to check that column usage matches what is set
  in the column usage bit maps. (This found a LOT of bugs in current
  column marking code).

- In 5.1 before, all used columns was marked in read_set and only updated
  columns was marked in write_set. Now we only mark columns for which we
  need a value in read_set.

- Column bitmaps are created in open_binary_frm() and open_table_from_share().
  (Before this was in table.cc)

- handler::table_flags() calls are replaced with handler::ha_table_flags()

- For calling field->val() you must have the corresponding bit set in
  table->read_set. For calling field->store() you must have the
  corresponding bit set in table->write_set. (There are asserts in
  all store()/val() functions to catch wrong usage)

- thd->set_query_id is renamed to thd->mark_used_columns and instead
  of setting this to an integer value, this has now the values:
  MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE
  Changed also all variables named 'set_query_id' to mark_used_columns.

- In filesort() we now inform the handler of exactly which columns are needed
  doing the sort and choosing the rows.

- The TABLE_SHARE object has a 'all_set' column bitmap one can use
  when one needs a column bitmap with all columns set.
  (This is used for table->use_all_columns() and other places)

- The TABLE object has 3 column bitmaps:
  - def_read_set     Default bitmap for columns to be read
  - def_write_set    Default bitmap for columns to be written
  - tmp_set          Can be used as a temporary bitmap when needed.
  The table object has also two pointer to bitmaps read_set and write_set
  that the handler should use to find out which columns are used in which way.

- count() optimization now calls handler::records() instead of using
  handler->stats.records (if (table_flags() & HA_HAS_RECORDS) is true).

- Added extra argument to Item::walk() to indicate if we should also
  traverse sub queries.

- Added TABLE parameter to cp_buffer_from_ref()

- Don't close tables created with CREATE ... SELECT but keep them in
  the table cache. (Faster usage of newly created tables).


New interfaces:

- table->clear_column_bitmaps() to initialize the bitmaps for tables
  at start of new statements.

- table->column_bitmaps_set() to set up new column bitmaps and signal
  the handler about this.

- table->column_bitmaps_set_no_signal() for some few cases where we need
  to setup new column bitmaps but don't signal the handler (as the handler
  has already been signaled about these before). Used for the momement
  only in opt_range.cc when doing ROR scans.

- table->use_all_columns() to install a bitmap where all columns are marked
  as use in the read and the write set.

- table->default_column_bitmaps() to install the normal read and write
  column bitmaps, but not signaling the handler about this.
  This is mainly used when creating TABLE instances.

- table->mark_columns_needed_for_delete(),
  table->mark_columns_needed_for_delete() and
  table->mark_columns_needed_for_insert() to allow us to put additional
  columns in column usage maps if handler so requires.
  (The handler indicates what it neads in handler->table_flags())

- table->prepare_for_position() to allow us to tell handler that it
  needs to read primary key parts to be able to store them in
  future table->position() calls.
  (This replaces the table->file->ha_retrieve_all_pk function)

- table->mark_auto_increment_column() to tell handler are going to update
  columns part of any auto_increment key.

- table->mark_columns_used_by_index() to mark all columns that is part of
  an index.  It will also send extra(HA_EXTRA_KEYREAD) to handler to allow
  it to quickly know that it only needs to read colums that are part
  of the key.  (The handler can also use the column map for detecting this,
  but simpler/faster handler can just monitor the extra() call).

- table->mark_columns_used_by_index_no_reset() to in addition to other columns,
  also mark all columns that is used by the given key.

- table->restore_column_maps_after_mark_index() to restore to default
  column maps after a call to table->mark_columns_used_by_index().

- New item function register_field_in_read_map(), for marking used columns
  in table->read_map. Used by filesort() to mark all used columns

- Maintain in TABLE->merge_keys set of all keys that are used in query.
  (Simplices some optimization loops)

- Maintain Field->part_of_key_not_clustered which is like Field->part_of_key
  but the field in the clustered key is not assumed to be part of all index.
  (used in opt_range.cc for faster loops)

-  dbug_tmp_use_all_columns(), dbug_tmp_restore_column_map()
   tmp_use_all_columns() and tmp_restore_column_map() functions to temporally
   mark all columns as usable.  The 'dbug_' version is primarily intended
   inside a handler when it wants to just call Field:store() & Field::val()
   functions, but don't need the column maps set for any other usage.
   (ie:: bitmap_is_set() is never called)

- We can't use compare_records() to skip updates for handlers that returns
  a partial column set and the read_set doesn't cover all columns in the
  write set. The reason for this is that if we have a column marked only for
  write we can't in the MySQL level know if the value changed or not.
  The reason this worked before was that MySQL marked all to be written
  columns as also to be read. The new 'optimal' bitmaps exposed this 'hidden
  bug'.

- open_table_from_share() does not anymore setup temporary MEM_ROOT
  object as a thread specific variable for the handler. Instead we
  send the to-be-used MEMROOT to get_new_handler().
  (Simpler, faster code)



Bugs fixed:

- Column marking was not done correctly in a lot of cases.
  (ALTER TABLE, when using triggers, auto_increment fields etc)
  (Could potentially result in wrong values inserted in table handlers
  relying on that the old column maps or field->set_query_id was correct)
  Especially when it comes to triggers, there may be cases where the
  old code would cause lost/wrong values for NDB and/or InnoDB tables.

- Split thd->options flag OPTION_STATUS_NO_TRANS_UPDATE to two flags:
  OPTION_STATUS_NO_TRANS_UPDATE and OPTION_KEEP_LOG.
  This allowed me to remove some wrong warnings about:
  "Some non-transactional changed tables couldn't be rolled back"

- Fixed handling of INSERT .. SELECT and CREATE ... SELECT that wrongly reset
  (thd->options & OPTION_STATUS_NO_TRANS_UPDATE) which caused us to loose
  some warnings about
  "Some non-transactional changed tables couldn't be rolled back")

- Fixed use of uninitialized memory in ha_ndbcluster.cc::delete_table()
  which could cause delete_table to report random failures.

- Fixed core dumps for some tests when running with --debug

- Added missing FN_LIBCHAR in mysql_rm_tmp_tables()
  (This has probably caused us to not properly remove temporary files after
  crash)

- slow_logs was not properly initialized, which could maybe cause
  extra/lost entries in slow log.

- If we get an duplicate row on insert, change column map to read and
  write all columns while retrying the operation. This is required by
  the definition of REPLACE and also ensures that fields that are only
  part of UPDATE are properly handled.  This fixed a bug in NDB and
  REPLACE where REPLACE wrongly copied some column values from the replaced
  row.

- For table handler that doesn't support NULL in keys, we would give an error
  when creating a primary key with NULL fields, even after the fields has been
  automaticly converted to NOT NULL.

- Creating a primary key on a SPATIAL key, would fail if field was not
  declared as NOT NULL.


Cleanups:

- Removed not used condition argument to setup_tables

- Removed not needed item function reset_query_id_processor().

- Field->add_index is removed. Now this is instead maintained in
  (field->flags & FIELD_IN_ADD_INDEX)

- Field->fieldnr is removed (use field->field_index instead)

- New argument to filesort() to indicate that it should return a set of
  row pointers (not used columns). This allowed me to remove some references
  to sql_command in filesort and should also enable us to return column
  results in some cases where we couldn't before.

- Changed column bitmap handling in opt_range.cc to be aligned with TABLE
  bitmap, which allowed me to use bitmap functions instead of looping over
  all fields to create some needed bitmaps. (Faster and smaller code)

- Broke up found too long lines

- Moved some variable declaration at start of function for better code
  readability.

- Removed some not used arguments from functions.
  (setup_fields(), mysql_prepare_insert_check_table())

- setup_fields() now takes an enum instead of an int for marking columns
   usage.

- For internal temporary tables, use handler::write_row(),
  handler::delete_row() and handler::update_row() instead of
  handler::ha_xxxx() for faster execution.

- Changed some constants to enum's and define's.

- Using separate column read and write sets allows for easier checking
  of timestamp field was set by statement.

- Remove calls to free_io_cache() as this is now done automaticly in ha_reset()

- Don't build table->normalized_path as this is now identical to table->path
  (after bar's fixes to convert filenames)

- Fixed some missed DBUG_PRINT(.."%lx") to use "0x%lx" to make it easier to
  do comparision with the 'convert-dbug-for-diff' tool.


Things left to do in 5.1:

- We wrongly log failed CREATE TABLE ... SELECT in some cases when using
  row based logging (as shown by testcase binlog_row_mix_innodb_myisam.result)
  Mats has promised to look into this.

- Test that my fix for CREATE TABLE ... SELECT is indeed correct.
  (I added several test cases for this, but in this case it's better that
  someone else also tests this throughly).
  Lars has promosed to do this.
2006-06-04 18:52:22 +03:00
guilhem@mysql.com
7921811e1f Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  mysql.com:/home/mysql_src/mysql-5.1-new-WL3146-handler
2006-06-02 22:22:59 +02:00
guilhem@mysql.com
a4e778f34d First push for WL#3146 "less locking in auto_increment". It is a 0-real-change patch.
New prototype for get_auto_increment() (but new arguments not yet used), to be able
to reserve a finite interval of auto_increment values from cooperating engines.
A hint on how many values to reserve is found in handler::estimation_rows_to_insert,
filled by ha_start_bulk_insert(), new wrapper around start_bulk_insert().
NOTE: this patch changes nothing, for all engines. But it makes the API ready for those
engines which will want to do reservation.
More csets will come to complete WL#3146.
2006-06-02 22:21:32 +02:00
mats@mysql.com
4092292c90 Bug#19995 (Extreneous table maps generated for statements that do not generate rows):
Switched to writing out table maps for tables that are locked when
the first row in a statement is seen.
2006-05-31 19:21:52 +02:00
gbichot@dl145j.mysql.com
09a1fca4a6 Merge bk://localhost:5556
into  dl145j.mysql.com:/users/gbichot/mysql-5.1-new
2006-05-17 22:43:47 +02:00
guilhem@mysql.com
c1b11edfac Removing the binlog-show-xid option as it was only a temporary solution until we have replace-regex which we have now.
That option was used to suppress the XID from the output of SHOW BINLOG EVENTS (to create a repeatable testsuite),
was available only in debug builds, and was explicitely marked as "may be removed in future versions" in mysqld --help.
Idea of the removal approved by the replication team.
2006-05-17 22:16:51 +02:00
mats@mysql.com
aa47bfa986 Merge mysqldev@production.mysql.com:my/mysql-5.1-release
into  mysql.com:/home/bk/b17400-mysql-5.1-new
2006-05-11 11:14:15 +02:00
mats@mysql.com
1c419c8671 Bug#17400 (CRBR: Delete and update of table w/o PK fails on slave):
Fixing bug where UPDATE failed on slave and some cleanup of ndb_unpack_record().
2006-05-11 11:09:58 +02:00
mats@mysql.com
4d0b8ce66f Plugging memory leak in row-based replication triggered by
test rpl_err_ignoredtables.
2006-05-09 12:30:06 +02:00
mats@mysql.com
67909baa28 WL#3259 (RBR with more columns on slave than on master):
Added support for UPDATE.
Some minor fixes.
2006-05-08 20:05:25 +02:00
tomas@poseidon.ndb.mysql.com
89df5b6b48 bug (colcnt) + compile fix 2006-05-04 11:15:14 +02:00
mats@mysql.com
77c4a2ca60 WL#3259 (RBR with more columns on slave than on master):
Extended replication to allow extra columns added last on slave
as compared with table on master.
2006-05-03 15:00:38 +02:00
mats@mysql.com
405ebbf231 Bug#17400 (Cluster Replication: Delete and update of row w/o PK fails):
Restarting scan after call to delete_row().
2006-04-12 21:19:24 +02:00
mats@mysql.com
3fd8cfe57c Bug#18436 (RBR: Replication to partition engine triggers assertion on slave):
Switching to using index_read() instead of index_read_idx() since a
range of rows need to be retrieved.
2006-03-27 14:58:37 +02:00
mats@mysql.com
2afb356b5c Bug#18436 (RBR: Replication to partition engine triggers assertion on slave side):
Partial fix for resolving the problem. Swapping contents of record[0]
and record[1] since this is what some storage engines expect.
2006-03-23 20:13:44 +01:00
mats@mysql.com
75834b6e01 Merge mysql.com:/home/bkroot/mysql-5.0
into  mysql.com:/home/bk/b18293-mysql-5.1-new
2006-03-21 20:17:28 +01:00
mats@mysql.com
1d4ee057ee BUG#18293 (Values in stored procedures written to binlog unescaped):
Generating character set-independent quoting of strings for the
binary log when executing statements from inside stored procedure.
2006-03-21 14:35:49 +01:00
knielsen@mysql.com
4d3ad1564d Misc. portability compile fixes. 2006-03-13 16:07:00 +01:00
mats@mysql.com
90215eb387 WL#3023 (Use locks in statement-like manner):
Post-merge patches.
2006-03-09 03:56:14 +01:00
mats@mysql.com
9dace13548 WL#3023 (Use locks in a statement-like manner):
Changes according to review comments.
2006-03-08 21:49:49 +01:00
mats@mysql.com
53f9de6c00 WL#3023 (Use locking in a statement-like manner):
Print a warning instead of error on failure to open non-existing table.
This is a temporary patch to prevent a bug in NDB from stopping the slave.
2006-03-08 20:42:09 +01:00
mats@mysql.com
9fb1e542fb Merge mysql.com:/home/bkroot/mysql-5.1-wl3023
into  mysql.com:/home/bk/w3023-mysql-5.1-new
2006-03-08 14:22:04 +01:00
mats@mysql.com
db4316a948 Merge mysql.com:/home/bkroot/mysql-5.1-new
into  mysql.com:/home/bk/w3171-mysql-5.1-new
2006-03-08 06:58:57 +01:00
mats@mysql.com
6a1d4bac6e WL#3171: Dynamic logging format
Removed error on seeing table map event when slave is in SBR mode
  and switching temporarily to RBR mode to replicate the rows.
2006-03-08 06:55:21 +01:00
mats@mysql.com
8d10f7b7a1 Merge mysql.com:/home/bkroot/mysql-5.1-new
into  mysql.com:/home/bk/w3023-mysql-5.1-new
2006-03-07 10:00:13 +01:00
mats@mysql.com
0713aa597a Bug#17874 (Test failure: rpl_row_basic_3innodb):
Some storage engines does not set the filler bits, so we set them
  before calling the record-reading functions.
2006-03-07 08:33:20 +01:00
mats@mysql.com
e0f5d35ceb Merge mysql.com:/home/bkroot/mysql-5.1-new
into  mysql.com:/home/bk/w3023-mysql-5.1-new
2006-03-03 09:57:42 +01:00
mats@mysql.com
0ffd1be87d WL#3023 (RBR: Use locks in a statement-like manner):
More adaptions to make it work with existing code base.
2006-03-03 09:49:46 +01:00
kent@mysql.com
5d722a8491 Merge 2006-02-28 23:29:58 +01:00
knielsen@mysql.com
19c4ba39c4 Windows compile fixes. 2006-02-28 12:52:38 +01:00
mats@mysql.com
1e66bc0d16 Merge mysql.com:/home/bkroot/mysql-5.1-new
into  mysql.com:/home/bk/w3023-mysql-5.1-new
2006-02-28 10:06:58 +01:00
lars@mysql.com
616a47cc6d BUG#17752: Non-allocated memory caused core in rpl_multi_engine test 2006-02-27 22:14:46 +01:00
mats@mysql.com
a865af0d4b Merge mysql.com:/home/bkroot/mysql-5.1-new
into  mysql.com:/home/bk/fix-mysql-5.1-release
2006-02-27 09:09:02 +01:00
kent@mysql.com
1bc614f204 log_event.cc:
Visual C++ dont relate 'byte' and 'char*' that close, added casts
mysql.sln:
  Only build mysqlserver.lib if embedded target
2006-02-26 01:16:11 +01:00
guilhem@mysql.com
0071749595 WL#2977 and WL#2712 global and session-level variable to set the binlog format (row/statement),
and new binlog format called "mixed" (which is statement-based except if only row-based is correct,
in this cset it means if UDF or UUID is used; more cases could be added in later 5.1 release):
SET GLOBAL|SESSION BINLOG_FORMAT=row|statement|mixed|default;
the global default is statement unless cluster is enabled (then it's row) as in 5.1-alpha.
It's not possible to use SET on this variable if a session is currently in row-based mode and has open temporary tables (because CREATE
TEMPORARY TABLE was not binlogged so temp table is not known on slave),  or if NDB is enabled (because
NDB does not support such change on-the-fly, though it will later), of if in a stored function (see below).
The added tests test the possibility or impossibility to SET, their effects, and the mixed mode,
including in prepared statements and in stored procedures and functions.
Caveats:
a) The mixed mode will not work for stored functions: in mixed mode, a stored function will
always be binlogged as one call and in a statement-based way (e.g. INSERT VALUES(myfunc()) or SELECT myfunc()).
b) for the same reason, changing the thread's binlog format inside a stored function is
refused with an error message.
c) the same problems apply to triggers; implementing b) for triggers will be done later (will ask
Dmitri).
Additionally, as the binlog format is now changeable by each user for his session, I remove the implication
which was done at startup, where row-based automatically set log-bin-trust-routine-creators to 1
(not possible anymore as a user can now switch to stmt-based and do nasty things again), and automatically
set --innodb-locks-unsafe-for-binlog to 1 (was anyway theoretically incorrect as it disabled
phantom protection).
Plus fixes for compiler warnings.
2006-02-25 22:21:03 +01:00
mats@mysql.com
13a61982a9 Merge mysqldev@production.mysql.com:my/mysql-5.1-release
into  mysql.com:/home/bk/w3023-mysql-5.1-new
2006-02-24 16:31:38 +01:00
mats@mysql.com
101edab125 WL#3023 (RBR: Use locks in a statement-like manner):
Adaptions to make it work with NDB.
2006-02-24 16:19:55 +01:00
lars@mysql.com
32a8a469a7 BUG#13418 (V2): Bit columns should replicate correctly when using RBR 2006-02-24 15:38:20 +01:00
mats@mysql.com
0cc0884200 Bug#17678 (RBR format change: moving from VLE to net encoding):
Switching to use net_*_length() instead of VLE functions.
2006-02-23 22:19:47 +01:00
konstantin@mysql.com
97d36a453e Post-merge fixes. 2006-02-22 20:03:25 +03:00
mats@mysql.com
43bc3c4068 Merge mysql.com:/home/bkroot/mysql-5.1-new
into  mysql.com:/home/bk/w3023-mysql-5.1-new
2006-02-16 08:46:45 +01:00
mats@mysql.com
2884408c75 WL#3023 (Use locks in a statement-like manner):
Table maps are now written on aquiring locks to tables and released
  at the end of each logical statement.
2006-02-16 08:30:53 +01:00
serg@serg.mylan
d5294e86bf Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new
into serg.mylan:/usr/home/serg/Abk/mysql-5.1
2006-02-15 14:04:56 +01:00
serg@serg.mylan
63cfd11859 dbug changes:
1. dbug state is now local to a thread
2. new macros: DBUG_EXPLAIN, DBUG_EXPLAIN_INITIAL,
   DBUG_SET, DBUG_SET_INITIAL, DBUG_EVALUATE, DBUG_EVALUATE_IF
3. macros are do{}while(0) wrapped
4. incremental modifications to the dbug state (e.g. "+d,info:-t")
5. dbug code cleanup, style fixes
6. _db_on_ and DEBUGGER_ON/OFF removed
7. rest of MySQL code fixed because of 3 (missing ;) and 6
8. dbug manual updated
9. server variable @@debug (global and local) to control dbug from SQL!
a. -#T to print timestamps in the log
2006-02-14 22:36:11 +01:00
aelkin@mysql.com
7397bc8fb4 Merge mysql.com:/usr_rh9/home/elkin.rh9/MySQL/Merge/5.0
into  mysql.com:/usr_rh9/home/elkin.rh9/MySQL/Merge/5.1-new
2006-02-14 20:48:34 +02:00
aelkin@mysql.com
14ced05e55 BUG#16217 fix partly backported from 5.0. It is different in mysqlbinlog part.
This changeset is assumed to stay in 4.1.
2006-02-10 15:12:27 +02:00
aelkin@mysql.com
dd2a44c497 BUG#16217 forced to introduce a separate mysql client command to adopt its
internal charset to one associated with currently being handled query. 
To note such a query can come from interactive client either.

There was a discussion within replication team and Monty who's suggestion won.
It avoids straightforward parsing of all `set' queries that could affect client side 
character set. 
According to the idea, mysql client does not parse `set' queries but rather cares of
`charset new_cs_name' command.
This command is generated by mysqlbinlog in form of exclaiming comment (Lars' suggestion)
so that enlightened clients like `mysql' knows what to do with it.

Interactive human can switch between many multi-byte charsets during the session 
providing the command explicitly. 
To note that setting new internal mysql's charset does not
trigger sending any `SET' sql statement to the server.
2006-02-09 16:23:09 +02:00
konstantin@mysql.com
92b41ba92a Merge mysql.com:/home/kostja/mysql/tmp_merge
into  mysql.com:/home/kostja/mysql/mysql-5.1-merge
2006-02-02 16:57:34 +03:00
brian@zim.tangent.org
570bffe8c7 Rename of my_strdup_with_lenght to match the more common "strndup" method. Soo its now my_strndup().
my_stat() gettinng the correct parameter list may be next :)
2006-01-25 19:54:42 -08:00
knielsen@mysql.com
113b1e4e6c Merge mysql.com:/usr/local/mysql/ab/mirrors/pullers/mysql-5.1-new
into  mysql.com:/usr/local/mysql/tmp5.1
2006-01-19 21:50:57 +01:00
cps@outpost.site
ce2eb6d8cb WL1019: complete patch. Reapplied patch to the clean
tree to get rid of multiple typos in CS comments and
unify the patch.
2006-01-19 05:56:06 +03:00