Commit graph

751 commits

Author SHA1 Message Date
aelkin/elkin@dsl-hkibras1-ff1dc300-249.dhcp.inet.fi
7c22049dfa Bug #26079 max_binlog_size + innodb = not make new binlog and hang server
There was hanging at binlog_commit by a thread executing autocommit query.

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

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

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

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

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

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

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

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

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

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

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

Added a lot of DBUG_PRINT() and DBUG_ASSERT() functions
Fixed compiler warnings
Fixed core dumps when running with --debug
Removed setting of signal masks (was never used)
Made event code call pthread_exit() (portability fix)
Fixed that event code doesn't call DBUG_xxx functions before my_thread_init() is called.
Made handling of thread_id and thd->variables.pseudo_thread_id uniform.
Removed one common 'not freed memory' warning from mysqltest
Fixed a couple of usage of not initialized warnings (unlikely cases)
Suppress compiler warnings from bdb and (for the moment) warnings from ndb
2007-02-23 13:13:55 +02:00
serg@janus.mylan
689eed7406 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  janus.mylan:/usr/home/serg/Abk/mysql-5.1
2007-02-21 11:36:23 +01:00
msvensson@pilot.blaudden
0af1b19568 Bug#20166 mysql-test-run.pl does not test system privilege tables creation
- Fixes for 5.1
2007-02-20 16:29:56 +01:00
msvensson@pilot.blaudden
0cc2e14040 Merge pilot.blaudden:/home/msvensson/mysql/bug20166/my50-bug20166
into  pilot.blaudden:/home/msvensson/mysql/bug20166/my51-bug20166
2007-02-20 16:26:30 +01:00
msvensson@pilot.blaudden
6caa0a232e Bug#20166 mysql-test-run.pl does not test system privilege tables creation
- Part 2, add @@hostname system variable
2007-02-20 16:24:38 +01:00
guilhem@gbichot3.local
03dfe4ab3f Merge gbichot3.local:/home/mysql_src/mysql-5.0-rpl-25507
into  gbichot3.local:/home/mysql_src/mysql-5.1-rpl-25507
2007-02-15 16:05:22 +01:00
guilhem@gbichot3.local
2f75c9cd69 Backport from the Falcon tree.
When opening/creating the transaction coordinator's log, if binlog is
used, the tc log is the binlog so we use the binlog's name; otherwise
we use the mmap-based log, named after the mandatory argument of the
--log-tc option (meant for that).
2007-02-15 15:50:56 +01:00
serg@janus.mylan
a07fd5fa8f WL#3700: Handler API change: all index search methods - that is,
index_read(), index_read_idx(), index_read_last(), and
records_in_range() - instead of 'uint keylen' argument take
'ulonglong keypart_map', a bitmap showing which keyparts are
present in the key value.
Fallback method is provided for handlers that are lagging behind.
2007-01-29 10:40:26 +01:00
monty@mysql.com/narttu.mysql.fi
410fc81a72 After merge fixes
Removed a lot of compiler warnings
Removed not used variables, functions and labels
Initialize some variables that could be used unitialized (fatal bugs)
%ll -> %l
2007-01-29 01:47:35 +02:00
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
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
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
mats@romeo.(none)
751c90ad8c BUG#22864 (CREATE-SELECT does not work correctly):
Post-merge fixes.
2006-12-22 12:09:44 +01:00
mats@romeo.(none)
8d4bddefd0 Merge romeo.(none):/home/bk/b22864-mysql-5.1-new-rpl
into  romeo.(none):/home/bk/merge-b22864-myql-5.1-new-rpl
2006-12-21 19:36:28 +01:00
mats@romeo.(none)
be9ffb12da BUG#22864 (Rollback following CREATE... SELECT discards 'CREATE TABLE'
from log):
When row-based logging is used, the CREATE-SELECT is written as two
parts: as a CREATE TABLE statement and as the rows for the table. For
both transactional and non-transactional tables, the CREATE TABLE
statement was written to the transaction cache, as were the rows, and
on statement end, the entire transaction cache was written to the binary
log if the table was non-transactional. For transactional tables, the
events were kept in the transaction cache until end of transaction (or
statement that were not part of a transaction).

For the case when AUTOCOMMIT=0 and we are creating a transactional table
using a create select, we would then keep the CREATE TABLE statement and
the rows for the CREATE-SELECT, while executing the following statements.
On a rollback, the transaction cache would then be cleared, which would
also remove the CREATE TABLE statement. Hence no table would be created
on the slave, while there is an empty table on the master.

This relates to BUG#22865 where the table being created exists on the
master, but not on the slave during insertion of rows into the newly
created table. This occurs since the CREATE TABLE statement were still
in the transaction cache until the statement finished executing, and
possibly longer if the table was transactional.

This patch changes the behaviour of the CREATE-SELECT statement by
adding an implicit commit at the end of the statement when creating
non-temporary tables. Hence, non-temporary tables will be written to the
binary log on completion, and in the even of AUTOCOMMIT=0, a new
transaction will be started. Temporary tables do not commit an ongoing
transaction: neither as a pre- not a post-commit.

The events for both transactional and non-transactional tables are
saved in the transaction cache, and written to the binary log at end
of the statement.
2006-12-21 09:29:02 +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
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
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
224660d14a Bug#22645 LC_TIME_NAMES: Statement not replicated
Problem: replication of LC_TIME_NAMES didn't work.
Thus, INSERTS or UPDATES using date_format() always
worked with en_US on the slave side.
Fix: adding ONE_SHOT implementation for LC_TIME_NAMES.
2006-12-05 13:45:21 +04:00
mskold/marty@linux.site
6f0e7a2631 Merge mysql.com:/windows/Linux_space/MySQL/mysql-5.1
into  mysql.com:/windows/Linux_space/MySQL/mysql-5.1-new-ndb
2006-12-01 21:12:13 +01:00
gni/root@ts3-168.ts.cn.tlan
24b1feea03 Merge ts3-168.ts.cn.tlan:/home/ngb/mysql/mysql-5.1/mysql-5.1-new-ndb-bj
into  ts3-168.ts.cn.tlan:/home/ngb/mysql/mysql-5.1/mysql-5.1-new-ndb
2006-12-01 11:35:05 +08:00
monty@mysql.com/narttu.mysql.fi
3d40956039 Fixed portability issue in my_thr_init.c (was added in my last push)
Fixed compiler warnings (detected by VC++):
- Removed not used variables
- Added casts
- Fixed wrong assignments to bool
- Fixed wrong calls with bool arguments
- Added missing argument to store(longlong), which caused wrong store method to be called.
2006-11-30 18:25:05 +02: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
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
lars@black.(none)
63c906f749 Merge mysql.com:/home/bkroot/mysql-5.1-new-rpl
into  mysql.com:/home/bk/MERGE/mysql-5.1-merge
2006-11-13 12:45:31 +01: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
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
anozdrin/alik@alik.
18fb4abff4 Merge alik.:/mnt/raid/alik/MySQL/devel/5.1-monty
into  alik.:/mnt/raid/alik/MySQL/devel/5.1-rt-merged
2006-11-03 14:00:35 +03:00
bar@mysql.com/bar.intranet.mysql.r18.ru
45ac13658b After merge fix for BUG#18908 ERROR 1406 (22001): Data too long for column :: using utf8 2006-11-03 10:18:13 +04:00
monty@mysql.com/nosik.monty.fi
ca99516cc7 Fixed a lot of compiler warnings (Mainly in mysqld and instance manager)
Fixed some possible fatal wrong arguments to printf() style functions
Initialized some not initialized variables
Fixed bug in stored procedure and continue handlers
(Fixes Bug#22150)
2006-11-01 19:41:09 +02: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
petr/cps@mysql.com/owlet.local
f01df1fd0a fix test failures in the runtime tree 2006-10-25 12:54:59 +04:00
petr/cps@owlet.local
eda71e24c3 Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  mysql.com:/home/cps/mysql/devel/5.1-rename-bug
2006-10-24 17:00:23 +04:00
petr/cps@mysql.com/owlet.local
6846f8d9c4 Fix for Bug #17544 "Cannot do atomic log rotate",
Bug #21785 "Server crashes after rename of the log table" and
Bug #21966 "Strange warnings on create like/repair of the log
            tables"

According to the patch, from now on, one should use RENAME to
perform a log table rotation (this should also be reflected in
the manual).

Here is a sample:

use mysql;
CREATE TABLE IF NOT EXISTS general_log2 LIKE general_log;
RENAME TABLE general_log TO general_log_backup, general_log2 TO general_log;

The rules for Rename of the log tables are following:
      IF   1. Log tables are enabled
      AND  2. Rename operates on the log table and nothing is being
              renamed to the log table.
      DO   3. Throw an error message.
      ELSE 4. Perform rename.
 
The very RENAME query will go the the old (backup) table. This is
consistent with the behavoiur we have with binlog ROTATE LOGS
statement.

Other problems, which are solved by the patch are:

1) Now REPAIR of the log table is exclusive operation (as it should be), this
   also eliminates lock-related warnings. and
2) CREATE LIKE TABLE now usese usual read lock on the source table rather
   then name lock, which is too restrictive. This way we get rid of another
   log table-related warning, which occured because of the above fact
   (as a side-effect, name lock resulted in a warning).
2006-10-13 17:26:46 +04:00
dli@dev3-76.dev.cn.tlan
01c02f34a9 ndb - fixed for BUG#15021, binlog_index table become inconsistent if errors during purge of binlogs.
if EMFILE error occured while purging binary logs, stop purging logs and report error message to user.
2006-10-13 12:48:05 +08:00
lars@black.(none)
0b4e65e12b Merge mysql.com:/home/bkroot/mysql-5.1-new-rpl
into  mysql.com:/home/bk/MERGE/mysql-5.1-merge
2006-10-10 21:59:23 +02:00
mats@romeo.(none)
cb1fdf5165 Fix to build on 64-bit systems where sizeof(unsigned long long)
> sizeof(unsigned long).
2006-10-06 08:41:34 +02:00
mats@romeo.(none)
93ea3261eb Post-merge fixes. 2006-10-05 22:16:19 +02:00
mats@romeo.(none)
fe97fd4bdb Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/b20265-mysql-5.1-new-rpl
2006-10-05 15:22:41 +02:00
mats@romeo.(none)
a4e0b4e61f I had forgotten to delete an already disabled line of C++ code.
---
BUG#20265 (Replication of CREATE-SELECT does not work correctly):
Fixing bug by making binary log handle statement transactions.
The binary log transaction cache can now be truncated to remove 
events inserted during this statement or transaction. Also, the
binary log participate in XA transaction handling, although not
as a full 2pc resource.
2006-10-05 10:46:14 +02:00
brian@zim.(none)
faff46eefe Added license information display to output of plugins schema, and tagged all plugins with GPL flag. 2006-10-05 00:41:29 -07:00
msvensson@neptunus.(none)
225b3e480b Merge bk-internal:/home/bk/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-10-03 20:28:59 +02:00
kroki/tomash@moonlight.intranet
8798b462b5 Fix for the patch for bug#21726: Incorrect result with multiple
invocations of LAST_INSERT_ID.

Reding of LAST_INSERT_ID inside stored function wasn't noted by caller,
and no LAST_INSERT_ID_EVENT was issued for binary log.

The solution is to add THD::last_insert_id_used_bin_log, which is much
like THD::last_insert_id_used, but is reset only for upper-level
statements.  This new variable is used to issue LAST_INSERT_ID_EVENT.
2006-10-03 13:38:16 +04:00
msvensson@neptunus.(none)
ca21b57992 Merge neptunus.(none):/home/msvensson/mysql/mysql-5.1
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint
2006-10-03 09:28:44 +02:00
tsmith/tim@siva.hindu.god
4c6dc3c461 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  siva.hindu.god:/usr/home/tim/m/bk/wl3516/51
2006-10-02 13:42:30 -06:00
brian@zim.(none)
46ae2113ba This patch adds handlerton passing to functions. NDB and Innodb still require a global hanlderton in the main code due to the nature of the sql_cache call back function (should be solveable... another patch).
Partitioning now has a flag to allow disabling of engines from being compatible with partitioning. Cleaned up heap naming convention on panic call.
2006-09-30 12:49:46 -07:00
tsmith/tim@siva.hindu.god
5ceadf8987 Merge siva.hindu.god:/usr/home/tim/m/bk/wl3516/50
into  siva.hindu.god:/usr/home/tim/m/bk/wl3516/51
2006-09-29 14:12:57 -06:00
tsmith/tim@siva.hindu.god
b7d0ec2422 WL #3516: MySQL Enterprise: implement Version Display Specification
Print version_comment after server version in:
mysql.cc:  Welcome message and 'status' command output
log.cc: Top of log files
2006-09-29 12:52:48 -06:00
brian@zim.(none)
4bce203fdf Merge zim.(none):/home/brian/mysql/merge-5.1
into  zim.(none):/home/brian/mysql/arch-5.1
2006-09-26 22:51:53 -07:00
brian@zim.(none)
f9a02811da Removed Field (this came in as an idea from a previous patch by Serg) 2006-09-26 21:26:04 -07: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
brian@zim.(none)
7194b6d75a This changes the order of the universe, black is now the new white.
In practice this means that handlerton is now created by the server and is passed to the engine. Plugin startups can now also control how plugins are inited (and can optionally pass values). Bit more flexibility to those who want to write plugin interfaces to the database.
2006-09-15 10:28:00 -07:00
lars/lthalmann@dl145j.mysql.com
a3adcfe52d Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new-rpl
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.1-merge
2006-09-15 01:46:47 +02:00
guilhem@gbichot3.local
a8836b7dde Fixing problems I identified in my auto_increment work pushed in July
(as part of the auto_increment cleanup of WL#3146; let's not be
sad, that monster push still removed serious bugs):
one problem with INSERT DELAYED (unexpected interval releases),
one with stored functions (wrong auto_inc binlogging).
These bugs were not released.
2006-09-12 15:42:13 +02:00
rburnett@production.mysql.com
db89fb33aa log.cc:
Fixing failed merge
2006-09-12 04:46:41 +02:00
lars/lthalmann@dl145j.mysql.com
1dfc84986e Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new-rpl
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.1-merge
2006-09-11 13:34:44 +02:00
rburnett@bk-internal.mysql.com
e70867872b Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into  bk-internal.mysql.com:/data0/bk/mysql-5.1-kt
2006-09-07 04:48:29 +02:00
rburnett@production.mysql.com
926d98d973 Merge production.mysql.com:/usersnfs/rburnett/tmp_merge2
into  production.mysql.com:/usersnfs/rburnett/mysql-5.1
2006-09-06 18:27:26 +02:00
brian@zim.(none)
1ac47c9513 Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.1
into  zim.(none):/tmp/merge-5.1
2006-09-06 09:23:47 -07:00
jonas@perch.ndb.mysql.com
7488c8fda8 Merge perch.ndb.mysql.com:/home/jonas/src/41-work
into  perch.ndb.mysql.com:/home/jonas/src/mysql-4.1-ndb
2006-09-04 14:45:13 +02:00
jonas@perch.ndb.mysql.com
fe808115e9 Merge perch.ndb.mysql.com:/home/jonas/src/50-work
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.0-ndb
2006-09-04 14:34:42 +02:00
jonas@perch.ndb.mysql.com
0b65cbaf5f bug#21965
merge to 5.1 - yet another merge fix
2006-09-04 14:26:18 +02:00
jonas@perch.ndb.mysql.com
f4392a98eb Merge perch.ndb.mysql.com:/home/jonas/src/50-work
into  perch.ndb.mysql.com:/home/jonas/src/51-work
2006-09-04 14:08:15 +02:00
jonas@perch.ndb.mysql.com
7ff631e890 Merge perch.ndb.mysql.com:/home/jonas/src/41-work
into  perch.ndb.mysql.com:/home/jonas/src/50-work
2006-09-04 13:46:56 +02:00
jonas@perch.ndb.mysql.com
96ff8b4c52 bug#21965 - replication
fix deadlock if master switches log file in parallell with "show master logs"
2006-09-04 13:43:34 +02:00
acurtis/antony@xiphis.org/ltantony.xiphis.org
38a59efbc9 add 2 placeholder values for config and system variables. 2006-08-30 14:27:29 -07:00
holyfoot/hf@mysql.com/deer.(none)
75be244cc7 Merge mysql.com:/home/hf/work/mysql-4.1.13717
into  mysql.com:/home/hf/work/mysql-5.0-mrg
2006-08-20 20:46:26 +05:00
mats@romeo.(none)
a982db81e4 Merging with mysql-5.1-new-rpl tree 2006-08-16 15:59:41 +02:00
mats@romeo.(none)
691355b6a3 BUG#20863 (if binlog format is changed between update and unlock table, wrong binlogging):
Fix to allow the binlog format to be changed between the LOCK and
UNLOCK tables, as well as under MIXED mode.
2006-08-16 14:55:57 +02:00
petr/cps@mysql.com/owlet.
be2ce2614b Fix Bug #18559 "log tables cannot change engine, and
gets deadlocked when dropping w/ log on"

Log tables rely on concurrent insert machinery to add data.
This means that log tables are always opened and locked by
special (artificial) logger threads. Because of this, the thread
which tries to drop a log table starts to wait for the table
to be unlocked. Which will happen only if the log table is disabled.
Alike situation happens if one tries to alter a log table.
However in addition to the problem above, alter table calls
check_if_locking_is_allowed() routine for the engine. The
routine does not allow alter for the log tables. So, alter
doesn't start waiting forever for logs to be disabled, but 
returns with an error.
Another problem is that not all engines could be used for
the log tables. That's because they need concurrent insert.

In this patch we:
(1) Explicitly disallow to drop/alter a log table if it
    is currently used by the logger.
(2) Update MyISAM to support log tables
(3) Allow to drop log tables/alter log tables if log is
    disabled
At the same time we (4) Disallow to alter log tables to
unsupported engine (after this patch CSV and MyISAM are 
alowed)
Recommit with review fixes.
2006-08-03 21:28:15 +04:00
holyfoot/hf@mysql.com/deer.(none)
21f721c6f5 bug #13717 embedded library dumps warnings on STDERR directly
Here i just disabled STDERR warnings in embedded server
Later we should get more defined about logs in the embedded server
2006-08-01 15:18:21 +05: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
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
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
lars@mysql.com
0e45d26993 Merge mysql.com:/users/lthalmann/bkroot/mysql-5.0
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.0-merge
2006-06-29 14:14:08 +02:00
lars@mysql.com
c75584d8d9 Merge mysql.com:/users/lthalmann/bk/mysql-5.0-rpl
into  mysql.com:/users/lthalmann/bk/mysql-5.1-new-rpl
2006-06-28 15:27:25 +02:00
aivanov@mysql.com
7dc30c68f4 Fixing BUG#17719 "Delete of binlog files fails on Windows"
and BUG#19208 "Test 'rpl000017' hangs on Windows".
 Both bugs are caused by attempting to delete an opened
 file and to create immediatedly a new one with the same
 name. On Windows it can be supported only on NT-platforms
 (by using FILE_SHARE_DELETE mode and with renaming the
 file before deletion). Because deleting not-closed files
 is not supported on all platforms (e.g. Win 98|ME) this
 is to be considered harmful and should be eliminated by
 a "code redesign".
2006-06-28 10:21:01 +04:00
rburnett@bk-internal.mysql.com
8472ce9ff8 Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into  bk-internal.mysql.com:/data0/bk/mysql-5.1-kt
2006-06-21 17:51:54 +02:00
gluh@eagle.intranet.mysql.r18.ru
8097ba2046 after merge fixes 2006-06-21 14:53:40 +05:00
rburnett@bk-internal.mysql.com
3edd9cc9c4 Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into  bk-internal.mysql.com:/data0/bk/mysql-5.1-kt
2006-06-19 17:50:11 +02:00
gluh@eagle.intranet.mysql.r18.ru
1d72c66c1b WL#3015: Logging Improvements - No Restarts(ver N4)
Added slow_query_log & general_log global upadatable variables.
Added slow-query-log & general-log startup options.
Added log_output, general_log_file, slow_query_log_file global updatable variables.
2006-06-19 18:30:55 +05:00
lars@dl145j.mysql.com
9bf46d4844 Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new-rpl
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.1-merge
2006-06-19 12:14:38 +02:00
serg@serg.mylan
694c1db79a Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into serg.mylan:/usr/home/serg/Abk/m51
2006-06-16 21:39:10 +02:00
serg@serg.mylan
d00b56549c String::set(double) and set(longlong) -> set_real() and set_int()
fix Field::store(double) being used instead of store(longlong)

NB: overloading functions is evil
2006-06-16 12:17:20 +02: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
petr@outpost.site
86420b38aa Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  mysql.com:/home/cps/mysql/devel/5.1-csv-remove-mmap
2006-06-15 15:38:14 +04: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
holyfoot@mysql.com
c2df72d6cb Merge 2006-06-09 19:09:42 +05:00
petr@mysql.com
9669d3ae58 Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  mysql.com:/home/cps/mysql/devel/5.1-logs-final
2006-06-07 23:58:08 +04:00
petr@mysql.com
319d1b818a WL #3153 "Split logs" post-review fixes (after andrei's review) 2006-06-05 05:34:34 +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
serg@sergbook.mysql.com
71657322fd Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new
into sergbook.mysql.com:/usr/home/serg/Abk/mysql-5.1
2006-05-28 14:54:28 +02:00
serg@sergbook.mysql.com
fe97dbb587 handlerton cleanup:
duplicate fields removed, st_mysql_storage_engine added to support
run-time handlerton initialization (no compiler warnings), handler API
is now tied to MySQL version, handlerton->plugin mapping added
(slot-based), dummy default_hton removed, plugin-type-specific
initialization generalized, built-in plugins are now initialized too,
--default-storage-engine no longer needs a list of storage engines
in handle_options().

mysql-test-run.pl bugfixes
2006-05-28 14:51:01 +02:00
holyfoot@deer.(none)
8485c574d9 bug #19650 (Embedded crashes in 5.1.10) 2006-05-24 13:28:24 +05:00
andrey@lmy004.
b429d73d62 fix for bug #17619 Scheduler race conditions
- Scheduler is either initialized at server start or never.
  Starting & stopping is now suspending & resuming.
- The scheduler has clear OO interface
- Now all calls to the scheduler are synchronous
- GLOBAL event_scheduler uses thd::sys_var_tmp (see set_var.cc)
- External API is encapsulated into class Events
- Includes fixes for all comments of Kostja's review of 19.05.2005

Starting to merge into 5.1-release (5.1.10) and push
2006-05-22 20:46:13 +02:00
lars@mysql.com
321db8e349 After merge fixes 2006-05-17 15:57:45 +02:00
lars@mysql.com
7cbba084d7 Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new
into  mysql.com:/users/lthalmann/bk/mysql-5.1-new-rpl
2006-05-17 15:14:07 +02:00
mats@mysql.com
66766ad596 Bug#16837 (Missing #ifdef cause compile problem --without-row-based-replication):
Added #ifdef's to make code work even when the system is built without
row-based replication.
2006-05-16 11:16:23 +02:00
holyfoot@mysql.com
4d4b5c8137 Merge 2006-05-12 14:16:20 +05:00
monty@mysql.com
8c7783c1e0 Don't use row level logging on optimize or repair table.
(Fixes core dump in rpl_failed_optimize.test)
Ensure we end active transcations if we do an admin command (like optimize, repair etc)
2006-05-05 20:08:40 +03:00
petr@mysql.com
fec70c97c9 WL#3153 "Split logs". Recommit with post-review fixes 2006-05-05 10:45:58 +04:00
monty@mysql.com
8f6ed291a7 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  mysql.com:/home/my/mysql-5.1
2006-05-04 01:58:21 +03:00
monty@mysql.com
d689f2fa70 Cleanups after review of WL#602
Fixed warnings from test suite
Some fixes in mysql-test-run script to catch more warnings
2006-05-03 19:40:52 +03:00
acurtis@xiphis.org
20b687ce0d WL#3201 post-review fixups 2006-05-02 12:04:20 -07:00
holyfoot@mysql.com
06b57c4871 Merge bk@192.168.21.1:mysql-5.1-new
into mysql.com:/home/hf/work/mysql-5.1.18518
2006-04-27 15:07:36 +05:00
acurtis@xiphis.org
53d4594cfe Merge xiphis.org:/home/antony/work2/wl3201.3
into  xiphis.org:/home/antony/work2/wl3201.merge
2006-04-24 13:36:15 -07:00
holyfoot@deer.(none)
25f56ce8b4 bug #18518 (embedded server crashes starting)
The problem is that now server works properly only with the 
row-based replication
2006-04-24 19:39:33 +05:00
petr@mysql.com
de97f94a49 fix for Bug#18848 "SIGHUP crashes the server" (v2) 2006-04-18 08:43:13 +04:00
brian@zim.(none)
5d1d27c016 Final patch to remove the last of the OS2 support. 2006-04-15 18:17:32 -07:00
acurtis@xiphis.org
4e11a4d941 WL#3201
" Configure support for server plugins "
2006-04-13 13:49:29 -07:00
joerg@mysql.com
06cba02907 Merge mysql.com:/M50/clone-5.0 into mysql.com:/M51/mysql-5.1 2006-04-07 16:45:47 +02:00
lars@mysql.com
9a12ddcf5e BUG#18116: Changed of how mutex is handled for XA and rotating binlog 2006-03-31 11:48:08 +02:00
monty@mysql.com
c3e7c7aa4b Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  mysql.com:/home/my/mysql-5.1
2006-03-29 17:28:40 +03:00
monty@mysql.com
1994ed49ec Fixed compiler and valgrind warnings
Added missing DBUG_xxx_RETURN statements
Fixed some usage of not initialized variables (as found by valgrind)
Ensure that we don't remove locked tables used as name locks from open table cache until unlock_table_names() are called.
This was fixed by having drop_locked_name() returning any table used as a name lock so that we can free it in unlock_table_names()
This will allow Tomas to continue with his work to use namelocks to syncronize things.

Note: valgrind still produces a lot of warnings about using not initialized code and shows memory loss errors when running the ndb tests
2006-03-29 14:27:36 +03:00
msvensson@shellback.
1d30dfdc00 Remove unused variable 2006-03-28 19:34:44 +02:00
petr@mysql.com
d91ea9e0cb Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  mysql.com:/home/cps/mysql/trees/mysql-5.1-virgin
2006-03-13 10:27:03 +03: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
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
petr@mysql.com
0e853c79b7 Fix Bug#17600: Invalid data logged into mysql.slow_log
Recommit with post-review fixes.
2006-03-06 21:03:17 +03:00
petr@mysql.com
0a861ec8c5 Remove unused thd->options's flag -- OPTION_UPDATE_LOG
The update log itself was removed back in 5.0. Recommit
with post-review fixes.
2006-03-04 11:20:56 +03: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
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
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
guilhem@mysql.com
473cfdfcb2 Merge mysql.com:/home/mysql_src/mysql-5.0
into  mysql.com:/home/mysql_src/mysql-5.1-new; will fix manually sp_head.cc and mysqld.cc later soon.
2006-02-18 19:07:32 +01:00
guilhem@mysql.com
4c5d18b150 Fix for BUG#16559 "Replication Problems with Non transactional tables inside an interrupted trans.":
problem was: when a connection disconnects having an open transaction affecting MyISAM and InnoDB, the ROLLBACK event stored in the binary log
contained a non-zero error code (1053 because of the disconnection), so when slave applied the transaction, slave complained that its ROLLBACK succeeded
(error_code=0) while master's had 1053, so slave stopped. But internally generated binlog events such as this ROLLBACK
should always have 0 as error code, as is true in 4.1 and was accidentally broken in 5.0,
so that there is no false alarm.
2006-02-18 17:19:16 +01: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
kent@mysql.com
eb9683442d Merge 2006-02-12 20:45:03 +01:00
petr@mysql.com
7aa7e4b437 Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  mysql.com:/home/cps/mysql/devel/5.1-utf-bug
2006-02-08 09:15:41 +03:00
petr@mysql.com
c29f832a68 Merge mysqldev@production.mysql.com:my/mysql-5.1-release
into  mysql.com:/home/cps/mysql/trees/5.1/5.1-virgin-no-debug
2006-02-06 17:35:10 +03:00
petr@mysql.com
b221e37b7d Fix for Bug#16905 Log tables: unicode statements are logged incorrectly 2006-02-03 13:05:14 +03:00
stewart@mysql.com
7458f115ed Merge mysql.com:/home/stewart/Documents/MySQL/5.1/new
into  mysql.com:/home/stewart/Documents/MySQL/5.1/wl1359
2006-02-01 18:23:34 +11:00
stewart@mysql.com
5c3d5e28af WL#1359 NDB: Add table handler and table information available from SQL commands
add a FILES table that allows the user to run SQL queries on the files used
to store their tables.

Currently supports NDB
2006-01-28 16:16:23 +13:00
petr@mysql.com
edf8bd2d52 fix safemalloc warnings 2006-01-27 16:10:40 +03:00
petr@mysql.com
a0f4c0ce30 Use one option --log-output[=option[,option...]]
instead of current --old-log-format and
--both-log-formats options
2006-01-27 13:41:15 +03:00
knielsen@mysql.com
08ef3d2b9d Fix formatting. 2006-01-20 13:51:18 +01:00
knielsen@mysql.com
c346208a40 Portability compilation fixes. 2006-01-20 13:23:24 +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
mikron@c-1e0be253.1238-1-64736c10.cust.bredbandsbolaget.se
e802a94284 WL #2604: Partition Management
Optimised version of ADD/DROP/REORGANIZE partitions for
non-NDB storage engines.
New syntax to handle REBUILD/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
Quite a few bug fixes
2006-01-17 08:40:00 +01:00
tomas@poseidon.ndb.mysql.com
4b731ddfb4 wl2325 wl2324 2006-01-12 19:51:02 +01:00
jonas@perch.ndb.mysql.com
161645c81e wl2723 - ndb opt. nr 2006-01-11 11:35:25 +01:00
mats@mysql.com
1c0b916ec1 Changes to support HP-UX. 2006-01-09 16:37:24 +01:00
mats@mysql.com
56db7a6b6e Bug#15924 (Core dump in sp_trans):
Added code for pending event flush just before executing the
  function or trigger.
2005-12-24 12:07:07 +01:00
lars@mysql.com
ad126d90e0 WL#1012: All changes as one single changeset.
This includes both code and test cases.
2005-12-22 06:39:02 +01:00
acurtis@xiphis.org
13a776778c Finalize storage engine plugins
Give BerkeleyDB savepoints
Remove "enum db_type" from most of the code
2005-12-21 10:18:40 -08:00
jani@a193-229-222-105.elisa-laajakaista.fi
5273071265 Merge a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.0
into  a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-new
2005-11-23 14:57:00 +02:00
bell@sanja.is.com.ua
7f162c7899 Merge sanja.is.com.ua:/home/bell/mysql/bk/work-bug1-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-merge-5.0
2005-11-21 21:15:48 +02:00
bell@sanja.is.com.ua
806f9e24ff Inefficient usage of String::append() fixed.
Bad examples of usage of a string with its length fixed.
The incorrect length in the trigger file configuration descriptor
  fixed (BUG#14090).
A hook for unknown keys added to the parser to support old .TRG files.
2005-11-20 20:47:07 +02:00
guilhem@mysql.com
2f95fc2701 Merge mysql.com:/home/mysql_src/mysql-5.0
into  mysql.com:/home/mysql_src/mysql-5.1-merge-of-5.0 (not all files are good,
I'll fix; I'll ask some devs to check their part)
2005-11-18 16:38:01 +01:00
SergeyV@selena.
00990f9774 Fixes bug #13377. my_open() & my_create() functions changed to use
my_sopen() on win32 which allows to use FILE_SHARE_DELETE flag to 
allow deleting opened files. my_sopen() implementation is added to
support this functionality.
2005-11-14 16:01:10 +03:00
brian@zim.(none)
510d0f24c8 Added handlerton flag to make storage engines invisable via flag. 2005-11-10 08:24:21 -08:00
acurtis@poseidon.ndb.mysql.com
c01a3b5e5f Make storage engines "pluggable", handlerton work 2005-11-07 16:25:06 +01:00
monty@mysql.com
a6f5375cb0 Merge mysql.com:/home/my/mysql-5.0
into  mysql.com:/home/my/mysql-5.1
2005-11-05 01:32:55 +02:00
monty@mysql.com
303f6b4a7a Reorder struct elements to be more optimal for 64 bit computers
(Main reason for reordering was to get rid of compiler warnings for order of element initialization)
2005-11-04 15:12:22 +02:00
monty@mysql.com
f2f4bf5240 wait_for_update must unlock mutex.
(Fixed failure in rpl0000008.test)
2005-11-02 19:28:49 +02:00
monty@mysql.com
1b3ed12017 Fixes during review of pushed code
Added back missing return in mysql_delete()
2005-10-27 15:15:01 +03:00
SergeyV@selena.
b357caab3d Bug #13377. Small update, code formatting. 2005-10-17 19:36:20 +04:00
SergeyV@selena.
3dec6a3b14 Merge svlasenko@bk-internal.mysql.com:/home/bk/mysql-5.0
into  selena.:H:/MYSQL/src/#13377-mysql-5.0
2005-10-17 19:09:12 +04:00
SergeyV@selena.
221a501120 Small update for #13377 patch 2005-10-17 19:03:54 +04:00
guilhem@mysql.com
4252b546b3 Merge mysql.com:/home/mysql_src/mysql-4.1
into  mysql.com:/home/mysql_src/mysql-5.0;
a very bad automerge (issues with non-ascii chars), plus some hard conflicts I'll fix by hand in a next cset
2005-10-12 21:58:02 +02:00
guilhem@mysql.com
4c1c9db823 Fix for BUG#13023: "SQL Thread is up but doesn't move forward". Details in slave.cc;
in short we now record whenever the slave I/O thread ignores a master's event because of its server id,
and use this info in the slave SQL thread to advance Exec_master_log_pos. Because if we
do not, this variable stays at the position of the last executed event, i.e. the last *non-ignored*
executed one, which may not be the last of the master's binlog (and so the slave *looks* behind
the master though it's data-wise it's not).
2005-10-12 13:29:55 +02:00
tomas@poseidon.ndb.mysql.com
e72fdf5619 Merge 2005-10-07 01:12:46 +02:00
serg@serg.mylan
b05a6d8fda don't "init" binlog if opt_bin_log is not set
(bug#13791 - mysqld crashes at startup in TC_LOG_MMAP::open)
2005-10-06 19:05:34 +02:00
tomas@poseidon.ndb.mysql.com
620b7bafb0 Merge 2005-10-06 10:54:07 +02:00
jani@ua141d10.elisa.omakaista.fi
a1b609f010 Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.0
into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0
2005-10-04 19:53:07 +03:00
jani@ua141d10.elisa.omakaista.fi
17e87da298 Some fixes including implicit declaration of a function,
using wrong type in assignment etc.
2005-10-04 18:20:57 +03:00
SergeyV@selena.
7d0d7826bb Fixes bug #13377. Added code to close active log files in case
of log reset condition.
2005-10-03 20:34:42 +04:00
brian@zim.(none)
54a958993c Next big patch for loadable storage engines!
Handlerton array is now created instead of using sys_table_types_st. All storage engines can now have inits and giant ifdef's are now gone for startup. No compeltely clean yet, handlertons will next be merged with sys_table_types. Federated and archive now have real cleanup if their inits fail.
2005-10-02 19:44:28 -07:00
konstantin@mysql.com
2d4c54ba1b Merge mysqldev@production.mysql.com:my/mysql-5.0-release
into  mysql.com:/opt/local/work/mysql-5.0-root
2005-09-23 00:46:59 +04:00
bell@sanja.is.com.ua
c1b185f5ff WL#2787 (Add view definer/owner to the view definition (.frm) to check privileges on used tables and stored routines when using a VIEW.)
Part 2 postreview fixes.
2005-09-20 21:20:38 +03:00
kent@mysql.com
19bae53ddc log.cc:
Cast my_munmap() argument to be able to compile on Solaris
2005-09-16 12:02:19 +02:00
bell@sanja.is.com.ua
aec371f910 WL#2787 (part 2, ver 3 (merged)) changed securety context switching 2005-09-15 22:29:07 +03:00
ndbdev@dl145b.mysql.com
46cc62e216 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1
2005-09-09 15:26:47 +02:00
sergefp@mysql.com
e5b4252481 Fix for BUG#12637: Make SPs+user variables replication work:
* Allocate thd->user_var_events elements on appropriate mem_root
* If several SP statements are binlogged as a single statement, collect all user var
  accesses they make (grep for StoredRoutinesBinlogging for details)
2005-09-07 19:39:47 +04:00
brian@zim.(none)
57403ddc9d Merge zim.(none):/home/brian/mysql/mysql-5.0
into  zim.(none):/home/brian/mysql/mysql-5.1

Resolved to minor issues.
2005-08-30 14:40:02 -07:00
sergefp@mysql.com
ad9bfc251c Slightly amended Monty's SP replication code cleanup patch 2005-08-27 02:33:06 +04:00
sergefp@mysql.com
95c3afc5d9 Fix for BUG#12335 (SP replication) : New binlogging strategy for stored PROCEDUREs/FUNCTIONs.
"Interleaved SPs execution is now binlogged properly, "SELECT spfunc()" is binlogged too.
The known remaining issue is binlogging/replication of "a routine is deleted while it is executed" scenario.
2005-08-25 17:34:34 +04:00
pappa@c-8b0ae253.1238-1-64736c10.cust.bredbandsbolaget.se
69acde961f Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-5.0
into  c-8b0ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/mysql-5.1
2005-08-05 18:01:34 -04:00
monty@mishka.local
8437e9c1be Fixes during review of new pushed code
Change bool in C code to my_bool
Added to mysqltest --enable_parsning and --disable_parsing to avoid to have to comment parts of tests
Added comparison of LEX_STRING's and use this to compare file types for view and trigger files.
2005-07-31 12:49:55 +03:00
monty@mysql.com
b3cbd0048f Cleanups during review of new code
Ensure mysql_close() is called if mysql_set_character_set() fails
2005-07-28 16:10:14 +03:00
tulin@dl145b.mysql.com
a6c21a0791 merge 2005-07-19 21:56:10 +02:00
monty@mishka.local
2278e0319c Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mishka.local:/home/my/mysql-5.0
2005-07-18 19:03:01 +03:00
monty@mishka.local
78c65b5adc Cleanups during review
Changed defaults option --instance to --defaults-group-suffix
Changed option handling to allow --defaults-file, --defaults-extra-file and --defaults-group-suffix to be given in any order
Changed MYSQL_INSTANCE to MYSQL_GROUP_SUFFIX
mysql_print_defaults now understands --defaults-group-suffix
Remove usage of my_tempnam() (not safe function)
if( -> if ( and while( to while (
2005-07-18 15:33:18 +03:00
tomas@poseidon.ndb.mysql.com
1affa6182a Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.1
2005-07-13 13:11:51 +02:00
lars@mysql.com
6db2602ad0 Merge mysql.com:/home/bkroot/mysql-4.1
into  mysql.com:/home/bk/mysql-5.0
2005-07-13 02:13:04 +02:00
lars@mysql.com
dc55af92ff BUG#6987: Added note when stat is failing on relay log, added mutex for log rotatation. 2005-07-12 06:01:26 +02:00
ndbdev@dl145b.mysql.com
723173c0f3 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1
2005-06-07 12:50:45 +02:00
jani@a193-229-222-105.elisa-laajakaista.fi
0d4c57f262 Moved tc_log_page_waits outside HAVE_MMAP,
because it's used also outside.
2005-06-07 11:45:28 +03:00
tomas@poseidon.ndb.mysql.com
5088b28d09 Merge 2005-05-31 14:37:47 +02:00
msvensson@neptunus.(none)
90f971ae2c Include fix to function open_binlog from 4.1
- Add O_SHARE when opening file.
2005-05-26 21:01:54 +02:00
lars@mysql.com
e76c641190 Merge mysql.com:/home/bk/mysql-5.0 into mysql.com:/home/bk/mysql-5.1 2005-05-09 11:45:59 +02:00
monty@mishka.local
a9f6aab4c9 Fixes while reviewing new code
Added option --count to mysqlshow (to show number of rows)
Fixed possible core dump in information schema
2005-05-06 11:39:30 +03:00
tomas@poseidon.ndb.mysql.com
033988f014 Merge 2005-04-25 22:21:25 +02:00
gbichot@quadita2.mysql.com
b75789e3d8 Fixes for BUG#10039 "MEMORY engine is reported as HEAP",
BUG#9738 "SHOW VARIABLES still displays the deprecated 'log_update' in 5.0",
BUG#9542 "MySQL dies with signal 11 when it is using non-existent location of binary logs"
2005-04-23 00:05:05 +02:00
lars@mysql.com
1bd55e471e Merging 5.0->5.1 2005-04-19 11:09:54 +02:00
serg@serg.mylan
810b2c3d40 remove the rest of isam/merge references
fix a race condition in TC_LOG_BINLOG::unlog
2005-04-05 13:17:49 +02:00
patg@patrick.local
8e0eb65f9a 5.0 to 5.1 merge 2005-04-01 12:32:17 -08:00
gbichot@production.mysql.com
56495a3691 Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-5.0
into production.mysql.com:/nfstmp1/guilhem/mysql-5.0-prod
2005-03-22 00:28:33 +01:00
gbichot@production.mysql.com
c766efdc5d Last part of WL#1062: better replication of timezones: no more use
of SET ONE_SHOT; storing tz info directly in event (if this info is needed),
it's now allowed to have different global tz on master and slave.
2005-03-22 00:26:12 +01:00
lars@mysql.com
efb077502d Merge 2005-03-21 23:05:55 +01:00
lars@mysql.com
c6d85289ab WL#2472:
Renamed Table_filter to Rpl_filter
Eliminated very annoying memory leak
2005-03-21 22:09:42 +01:00
jimw@mysql.com
ee2b4ec959 Eliminate warnings noticed by VC7. This includes fixing my_mmap() on
Windows to call CreateFileMapping() with correct arguments, and
propogating the introduction of query_id_t to everywhere query ids are
passed around. (Bug #8826)
2005-03-18 16:12:25 -08:00
serg@serg.mylan
3613f8c262 sql/log.cc
don't set LOG_EVENT_BINLOG_IN_USE_F for relay logs
sql/sql_repl.cc
    clear LOG_EVENT_BINLOG_IN_USE_F flag before sending an event to a slave
2005-03-14 17:53:24 +01:00
serg@serg.mylan
a6b3b8fa98 print more information 2005-03-14 09:27:34 +01:00
serg@serg.mylan
8986ffebde print xa recovery progress
add names to handlertons
trans_need_2pc() macro
2005-03-13 21:58:09 +01:00
lars@mysql.com
7ed7fc7f58 WL#2472: Addendum: Fixes after Mats review 2005-03-10 14:36:48 +01:00
serg@serg.mylan
c49928447d Merge bk-internal:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
2005-03-09 13:02:51 +01:00
serg@serg.mylan
1e09c15a8b don't close binlog in the destructor - use explictit MYSQL_LOG::cleanup for this 2005-03-09 12:29:51 +01:00
lars@mysql.com
26787260b7 WL#2472: Refactoring of replication and binlog filtering.
Needed to be able to have multiple masters connected 
to same slave server with different filters.
2005-03-08 21:12:35 +01:00
gluh@gluh.mysql.r18.ru
66bd0447e4 Fix for bug#8740: Server crash at start on Solaris 9 (64 bit) 2005-03-03 17:38:58 +03:00
serg@serg.mylan
02d88c398f bug#8151 - truncate leaves a transaction open
deadlock in MYSQL_LOG::new_file()
style fixes
2005-03-02 10:38:25 +01:00
monty@mysql.com
7e5f74f8f2 Merge with global tree 2005-02-25 17:12:06 +02:00
monty@mysql.com
0a6b7aedb2 Remove compiler warnings and remove not used variables
(Found during build process)
2005-02-25 16:53:22 +02:00
mats@mysql.com
bfce3aee8d Bug#8412: merged from 4.1 2005-02-23 23:01:51 +01:00