Commit graph

488 commits

Author SHA1 Message Date
monty@mysql.com
4bc6b551f8 false/true -> FALSE/TRUE
Fixes after last merge
2004-03-30 02:32:41 +03:00
serg@serg.mylan
d1f1bbefab sys_var_str.value is never NULL 2004-03-20 15:56:20 +01:00
monty@mysql.com
350b433569 merge with 4.0 2004-03-16 22:41:30 +02:00
guilhem@mysql.com
69517b22a1 Fix for BUG#2983 "If statement was killed on master, slave errors despite replicate-wild-ignore-t"
We introduce a new function mysql_test_parse_for_slave().
If the slave sees that the query got a really bad error on master
(killed e.g.), then it calls this function to know if this query
can be ignored because of replicate-*-table rules (do not worry
about replicate-*-db rules: they are checked so early that they have
no bug). If the answer is yes, it skips the query and continues. If
it's no, then it stops and say "fix your slave data manually" (like it
did before this change).
2004-03-11 17:38:19 +01:00
guilhem@mysql.com
cf287341cc Fix for BUG#2921 "Replication problem on mutex lock in mySQL-4.0.18":
re-using unused LOCK_active_mi to serialize all administrative
commands related to replication:
START SLAVE, STOP SLAVE, RESET SLAVE, CHANGE MASTER, init_slave()
(replication autostart at server startup), end_slave() (replication
autostop at server shutdown), LOAD DATA FROM MASTER.
This protects us against a handful of deadlocks (like BUG#2921
when two START SLAVE, but when two STOP SLAVE too).
Removing unused variables.
2004-03-11 16:23:35 +01:00
guilhem@mysql.com
1c0d5ad25c Backporting parts of
ChangeSet 1.1620.12.1 and ChangeSet 1.1625.2.1
from 4.1. This makes the slave I/O thread flush the relay log 
after every event, which provides additional safety in case
of brutal crash (reduces chances to lose a part of the relay log).
2004-03-10 16:56:28 +01:00
guilhem@mysql.com
30541b324c Undoing 2 parts of changeset 1.1730.1.1 :
- the one about BUG#2921
- the one about relay log flushing
Both will be rewritten in a next changeset
(this one will not be pushed before the next changeset).
2004-03-10 16:30:47 +01:00
monty@mysql.com
4ee44751d9 Fixed memory leak in DROP DATABASE when using RAID tables (Bug #2882) 2004-03-10 13:46:11 +02:00
guilhem@mysql.com
6cf1059f9d More comments on what could explain -1 in Seconds_Behind_Master in
SHOW SLAVE STATUS.
2004-03-02 23:03:52 +01:00
guilhem@mysql.com
db37d9a062 After hours of unsuccessful research on
BUG#2826 "Seconds behind master weirdness"
(sometimes this column of SHOW SLAVE STATUS shows a very big value,
in fact a small negative number casted to ulonglong).
This problem was reported by only one user, but which uses
synchronized time between his servers.
As suggested by the user, to hide this I display max(0, the value)
so that it will be less confusing. For a user, seeing 0 is probably
better than seeing -1 (both tell you that the slave is very close
to the master).
2004-03-02 22:38:14 +01:00
monty@mysql.com
ce14578909 Merge with 4.0.18 2004-02-11 00:06:46 +01:00
pem@mysql.com
c8585f3283 Merge 4.1 into 5.0. 2004-02-10 18:44:02 +01:00
guilhem@mysql.com
0c55118883 Fix for BUG#2452 "Empty LOAD DATA INFILE failes with the master in 3.23.x":
do not write the Execute_load_log_event if there was no Create_file_log_event
(empty file).
2004-01-20 15:41:22 -05:00
monty@mysql.com
8d23612303 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/my/mysql-4.1
2003-12-26 12:32:24 +02:00
monty@mysql.com
458a947f6c Fixed bug in table level privilege GRANT handling. (Bug #2178)
Portability fixes
2003-12-26 12:32:02 +02:00
konstantin@oak.local
2a25b2617a Prepared_statement deployed instead of PREP_STMT. 2003-12-20 02:16:10 +03:00
guilhem@mysql.com
1333f636ae Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/mysql_src/mysql-5.0-new-binlog-format
2003-12-19 23:05:07 +01:00
guilhem@gbichot2
df3b1a54f4 This is the final commit for Worklog tasks:
* A more dynamic binlog format which allows small changes (1064)
   * Log session variables in Query_log_event (1063)
It contains a few bugfixes (which I made when running the testsuite).
I carefully updated the results of the testsuite (i.e. I checked for every one,
if the difference between .reject and .result could be explained).
Apparently mysql-test-run --manager is broken in 4.1 and 5.0 currently,
so I could neither run the few tests which require --manager, nor check
that they pass nor modify their .result. But for builds, we don't run
with --manager.
Apart from --manager, the full testsuite passes, with Valgrind too (no errors).
I'm going to push in the next minutes. Remains: update the manual.
Note: by chance I saw that (in 4.1, in 5.0) rpl_get_lock fails when run alone;
this is normal at it makes assumptions on thread ids. I will fix this one day
in 4.1.
2003-12-19 22:40:23 +01:00
konstantin@oak.local
d37da004f6 THD::lex now points to THD::main_lex like in 5.0
All tests pass (client_test included)
2003-12-19 20:52:13 +03:00
pem@mysql.com
99e0ae85c7 Merge 4.1 to 5.0. 2003-12-19 18:03:27 +01:00
monty@mysql.com
d4c32db181 merge with 4.0.18 2003-12-19 16:42:17 +02:00
guilhem@gbichot2
66a32e8925 This will be pushed only after I fix the testsuite.
This is the main commit for Worklog tasks:
 * A more dynamic binlog format which allows small changes (1064)
 * Log session variables in Query_log_event (1063)
Below 5.0 means 5.0.0.
MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed),
SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think
of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this
works for queries, except LOAD DATA INFILE (for this it would have to wait
for Dmitri's push of WL#874, which in turns waits for the present push, so...
the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1,
5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1.
Apart from that, the new binlog format is designed so that it can tolerate
a little variation in the events (so that a 5.0.0 slave could replicate a
5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I
later add replication of charsets it should break nothing. And when I later
add a UID to every event, it should break nothing.
The main change brought by this patch is a new type of event, Format_description_log_event,
which describes some lengthes in other event types. This event is needed for
the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event,
we can later add more bytes to the header of every event without breaking compatibility.
Inside Query_log_event, we have some additional dynamic format, as every Query_log_event
can have a different number of status variables, stored as pairs (code, value); that's
how SQL_MODE and session variables and catalog are stored. Like this, we can later
add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows
if we want.
MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs.
Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs),
upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs);
so both can be "hot" upgrades.
Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0.
3.23 and 4.x can't be slaves of 5.0.
So downgrading from 5.0 to 4.x may be complicated.
Log_event::log_pos is now the position of the end of the event, which is
more useful than the position of the beginning. We take care about compatibility
with <5.0 (in which log_pos is the beginning).
I added a short test for replication of SQL_MODE and some other variables.
TODO:
- after committing this, merge the latest 5.0 into it
- fix all tests
- update the manual with upgrade notes.
2003-12-18 01:09:05 +01:00
guilhem@mysql.com
508d5e5b9d Fix for BUG#2145 "mysqld becomes unreliable if unable to create a relay log when replic starts":
release the mutex before exiting the function, or it will be kept forever
(=> START SLAVE, STOP SLAVE, etc will hang).
2003-12-17 23:29:11 +01:00
monty@mysql.com
e0cc6799ec Merge with 4.0.17 2003-12-17 17:35:34 +02:00
pem@mysql.com
24a2ae44a3 Merged 4.1 -> 5.0 2003-12-09 19:00:34 +01:00
gluh@gluh.mysql.r18.ru
a09d6409ae post-merge fixes 2003-12-08 09:44:04 +04:00
gluh@gluh.mysql.r18.ru
b46d75f08b Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections.
(Similar to the client command: mysql_options(... MYSQL_INIT_COMMAND ...).
2003-12-08 09:13:14 +04:00
guilhem@mysql.com
dd2303ce07 - Fix for BUG#1858 "SQL-Thread stops working when using optimize table":
we change THD::system_thread from a 'bool' to a bitmap to be able to
distinguish between delayed-insert threads and slave threads.
- Fix for BUG#1701 "Update from multiple tables" (one line in sql_parse.cc,
plus a new test rpl_multi_update.test). That's just adding an initialization.
2003-12-04 22:42:18 +01:00
konstantin@mysql.com
f2377c4dc9 manual merge 2003-12-04 18:15:45 +03:00
guilhem@mysql.com
1b4bd22bd7 Fix for BUG#2011 "rare race condition producing "binlog has bad magic number" error in slave".
The problem was that when the slave SQL thread reads a hot relay log (hot = the one being written to by the
slave I/O thread), it must have the LOCK_log. It already took it for read_log_event(), but needs
it also for check_binlog_magic().
This should fix all recently reported failures of the rpl_max_relay_size test in 4.1 and 5.0
(though the bug exists since 4.0, it showed up first in 5.0).
2003-12-04 15:30:14 +01:00
pem@mysql.com
6e717133c5 Merge 4.1 to 5.0 2003-12-01 16:14:40 +01:00
guilhem@mysql.com
c9fd311aac In the slave I/O thread (in master.info), it seems less worse to flush
the relay log before flushing master.info.
Doing 'before' leads to duplicate event, doing after leads to missing event.
Both can be as destructive, but 'duplicate' enables us to later add detection
code to catch it. Whereas 'missing' can't be caught (it can't, because
the I/O thread can produce legal position jumps, for example if it has
ignored an event coming from this slave (rememember that starting from 4.1.1,
the I/O thread filters the server id).
2003-11-28 16:15:21 +01:00
konstantin@oak.local
c75bb0a654 Second attempt: trying to add Statement context to sources.
Added classes Statement, Statement_map
Merge commit
2003-11-27 20:51:53 +03:00
guilhem@gbichot2
05e5a35bf2 Replication:
Now the I/O thread (in flush_master_info()) flushes the relay log to disk
after reading every event. Slower but provides additionnal safety in case
of brutal crash.
I had to make the flush optional (i.e. add a if(some_bool_argument) in the function)
because sometimes flush_master_info() is called when there is no usable
relay log (the relay log's IO_CACHE is not initialized so can't be flushed).
2003-11-23 17:02:59 +01:00
paul@teton.kitebird.com
9b4050c406 Merge paul@bk-internal.mysql.com:/home/bk/mysql-4.1
into teton.kitebird.com:/home/paul/mysql-4.1
2003-11-21 23:02:06 -06:00
monty@mysql.com
d87494c5ac Don't flush cur_log (relay log) on flush_relay_log_info becasue this crashes the server if cur_log is 'hot' and the io_thread has changed log file.
Updated project files for windows
Made rpl_change_master.test portable
Ensure that mutex are not freed if not initilized
2003-11-22 03:21:40 +02:00
paul@teton.kitebird.com
7a1bb450a6 Change word order of a few PROCESSLIST messages to correspond
to order used in START SLAVE syntax.
2003-11-21 12:35:33 -06:00
paul@ice.snake.net
53c93091f2 Write slave status field names using consistent style.
(Initial caps for each word.) For example, instead of writing
Until_condition, Until_Log_File, and Until_log_pos, write
Until_Condition, Until_Log_File, and Until_Log_pos.
2003-11-20 13:07:25 -06:00
pem@mysql.com
28a2c6a96b Merging 4.1->5.0. 2003-11-19 15:19:46 +01:00
monty@narttu.mysql.fi
4e4725377d Merge with 4.0 2003-11-04 09:40:36 +02:00
guilhem@mysql.com
fbc54c139d When we delete the slave's temp tables from memory, we reset
rli->save_temporary_tables and slave_open_temp_tables
(in old 4.0 you could make "SHOW STATUS LIKE 'slave_open_temp_tables'" grow
indefinitely by doing RESET SLAVE and replicating always the same CREATE
TEMPORARY TABLE).
It's critical to reset save_temporary_tables to 0 (otherwise you may later
read memory which has been freed) so this changeset should go into 4.1.
2003-11-03 18:24:01 +01:00
guilhem@mysql.com
c1f7f33960 4 small items in this:
- when we don't have in_addr_t, use uint32.
- a forgotten initialization of slave_proxy_id in sql/log_event.cc (was not really "forgot", was
"we needn't init it there", but there was one case where we needed...).
- made slave_proxy_id always meaningful in THD and Log_event, so we can
rely more on it (no need to test if it's meaningful). THD::slave_proxy_id
is equal to THD::thread_id except for the slave SQL thread.
- clean up the slave's temporary table (i.e. free their memory) when slave
server shuts down.
2003-10-31 23:20:23 +01:00
guilhem@mysql.com
59d0872aa0 Fix for BUG#1686
"If 2 master threads with same-name temp table, slave makes bad binlog"
and (two birds with one stone) for
BUG#1240 "slave of slave breaks when STOP SLAVE was issud on parent slave
and temp tables".

Here is the design change:
in a slave running with --log-slave-updates, events are now logged with the
thread id they had on the master. So no more id conflicts between master threads,
but introduces id conflicts between one master thread and one normal 
client thread connected to the slave. This is solved by storing the server id
in the temp table's name.

New test which requires mysql-test-run to be run with --manager,
otherwise it will be skipped.

Undoing a Monty's change (hum, a chill runs down my spine ;) which was
"Cleanup temporary tables when slave ends" in ChangeSet 1.1572.1.1.
2003-10-29 14:23:35 +01:00
pem@mysql.comhem.se
692609537d Post-merge fixes. 2003-10-23 16:06:51 +02:00
pem@mysql.com
337238b78a Merging 4.1->5.0 2003-10-22 16:10:22 +02:00
serg@serg.mylan
f944fd4a65 merged 2003-10-21 11:58:43 +02:00
guilhem@mysql.com
ce6d736714 A fix for a random test failure rpl_trunc_binlog: don't RESET MASTER
while the slave is connected.
2003-10-17 00:00:25 +02:00
monty@mashka.mysql.fi
e87c9f5ff8 merge with 4.0 2003-10-16 03:08:40 +03:00
monty@mashka.mysql.fi
84d9d98078 Better fix for CREATE TABLE IF NOT EXISTS ... SELECT
Fixed chsize() problem on windows
Extend default timeout on windows clients to 1 year (to avoid timeout problems)
2003-10-15 21:41:13 +03:00
serg@serg.mylan
50d9b95b77 merged 2003-10-15 12:25:44 +02:00
serg@serg.mylan
8cc3951c8f key_map with more that 64 bits width 2003-10-11 13:06:55 +02:00
guilhem@mysql.com
b2500829a3 Make the slave die if master is 5.0. Indeed, 5.0 masters send
a Format_description_log_event (or maybe it will be named
Description_log_event) which is not recognized by 4.0, so
a 4.0 can't be a slave of 5.0. We detect it early to produce
a helpful message instead of "corrupted relay log" later.
2003-10-09 17:40:38 +02:00
guilhem@gbichot2
c0075fa64b Final push for WL#1098:
"Add a column "Timestamp_of_last_master_event_executed" in SHOW SLAVE STATUS".
Finally this is adding
- Slave_IO_State (a copy of the State column of SHOW PROCESSLIST for the I/O thread,
so that the users, most of the time, has enough info with only SHOW SLAVE STATUS).
- Seconds_behind_master. When the slave connects to the master it does SELECT UNIX_TIMESTAMP()
on the master, computes the absolute difference between the master's and the slave's clock.
It records the timestamp of the last event executed by the SQL thread, and does a
small computation to find the number of seconds by which the slave is late.
2003-10-09 00:06:21 +02:00
monty@narttu.mysql.fi
d9ff665102 Fixes after merge 2003-10-08 12:01:58 +03:00
monty@narttu.mysql.fi
6056cfadfc Merge with 4.0.16 2003-10-07 15:42:26 +03:00
pem@mysql.com
8d884c02bb Merging 4.1 -> 5.0 2003-09-24 11:29:38 +02:00
hf@deer.(none)
a2dbfaefa3 SCRUM
embedded library
hash_insert renamed to my_hash_insert to avoid name intersection
with another libraries
is there better idea?
2003-09-19 14:44:31 +05:00
dlenev@mysql.com
2c24b2e9b4 Manual merge after commiting START SLAVE UNTIL 2003-09-14 01:57:09 +04:00
dlenev@dlenev.mshome
c0cfae1c8d Implemented support for START SLAVE UNTIL (WL#868) 2003-09-14 00:13:41 +04:00
guilhem@mysql.com
59663fc661 * Fix for BUG#1248: "LOAD DATA FROM MASTER drops the slave's db unexpectedly".
Now LOAD DATA FROM MASTER does not drop the database, instead it only tries to
create it, and drops/creates table-by-table.
* replicate_wild_ignore_table='db1.%' is now considered as "ignore the 'db1'
database as a whole", as it already works for CREATE DATABASE and DROP DATABASE.
2003-09-11 23:17:28 +02:00
monty@mashka.mysql.fi
45aa92c574 After merge fixes.
Note that mix_innodb_myisam_binlog and union fails after this patch (Will be fixed shortly by maintaners of this code)
2003-09-11 19:06:23 +03:00
monty@narttu.mysql.fi
4b3b4b9250 merge 2003-09-03 19:53:08 +03:00
kostja@oak.local
424a647069 post-merge fixes 2003-09-03 16:43:41 +04:00
kostja@oak.local
36dd82c1d5 merge commit, hope that none of bar and dlenev changes were
lost.
2003-09-03 14:12:10 +04:00
dlenev@mysql.com
73ab4be246 Manual merge fixes 2003-09-01 16:14:54 +04:00
dlenev@dlenev.mshome
2486222cd2 Implemented replication over SSL
Added proper options to CHANGE MASTER TO, new fields to SHOW SLAVE STATUS,
 Honoring this parameters during connection to master.
 Introduced new format of master.info file
2003-09-01 15:16:20 +04:00
monty@narttu.mysql.fi
77a70a0a24 merge with 4.0.15 2003-08-29 13:44:35 +03:00
monty@narttu.mysql.fi
60dd8a2c4f hanged UDF interface to use clear() instead of reset() 2003-08-27 22:30:50 +03:00
pem@mysql.telia.com
08e5a7e135 Post-merge fixes. 2003-08-26 17:41:40 +02:00
pem@mysql.com
7f158dd12a Merge 4.1 into 5.0 2003-08-26 11:51:09 +02:00
guilhem@mysql.com
cc29458056 comments about mutexes in replication.
Don't start the SQL slave thread with SQL_BIG_SELECTS;
it's better to inhibate max_join_size instead.
2003-08-25 16:20:21 +02:00
guilhem@mysql.com
6c9cff9534 Clearer states in SHOW PROCESSLIST for replication threads.
For example the Binlog_dump thread (on the master) sometimes showed "Slave:".
And there were confusing messages where "binlog" was employed instead
of "relay log".
2003-08-25 14:13:58 +02:00
guilhem@mysql.com
cc918272ed The slave threads MUST not care about max_join_size, we start them with
OPTION_BIG_SELECTS.
2003-08-23 17:41:43 +02:00
guilhem@mysql.com
10811aba88 * Fix for a potential bug:
when the SQL thread stops, set rli->inside_transaction to 0. This is needed if the user
later restarts replication from a completely different place where there are only autocommit
statements.
* Detect the case where the master died while flushing the binlog cache to the binlog
and stop with error. Cannot add a testcase for this in 4.0 (I tested it manually)
as the slave always runs with --skip-innodb.
2003-08-23 16:53:04 +02:00
guilhem@mysql.com
165dc895b3 Yesterday I removed process_io_create_file; I shouldn't have.
Let's say the lack of comments did not help me ;)
Copying it back again and adding comments; now 3.23->4.0
replication of LOAD DATA INFILE works again.
2003-08-21 10:24:37 +02:00
guilhem@mysql.com
f405287beb Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/mysql_src/mysql-4.0
2003-08-20 23:25:58 +02:00
guilhem@mysql.com
1dd53ed073 First commit for fixing BUG#1100
"LOAD DATA INFILE is badly filtered by binlog-*-db rules".
There will probably be a second final one to merge Dmitri's changes
to rpl_log.result and mine.
2 new tests:
rpl_loaddata_rule_m : test of logging of LOAD DATA INFILE when the master has binlog-*-db rules,
rpl_loaddata_rule_s : test of logging of LOAD DATA INFILE when the slave has binlog-*-db rules and --log-slave-updates.
2003-08-20 23:24:45 +02:00
dlenev@mysql.com
bb96092202 Fix for BUG#1086. Now we don't preserve event's log_pos through
log-slave-updates since this causes unexpected values in 
Exec_master_log_pos in A->B->C replication setup, synchronization
 problems in master_pos_wait()... 
Still this brokes some functionality in sql/repl_failsafe.cc 
(but this file is not used now)
2003-08-20 03:38:31 +04:00
monty@mashka.mysql.fi
eb6458cb18 After merge fixes + bugs from last merge 2003-08-19 16:00:12 +03:00
monty@mashka.mysql.fi
4f7512160b After merge fixes
Use server character set if --default-character-set is not used
Added convert_string() for more efficient alloc+character-set convert of strings
2003-08-19 00:08:08 +03:00
monty@mashka.mysql.fi
2263e3e51f Merge with 4.0.14 2003-08-11 22:44:43 +03:00
monty@mashka.mysql.fi
6e7a509d06 Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into mashka.mysql.fi:/home/my/mysql-4.0
2003-08-07 20:18:51 +03:00
monty@mashka.mysql.fi
8f08c511ee Review of changesets since last pull.
(Mostly code cleanups)
2003-08-07 20:16:37 +03:00
guilhem@mysql.com
bb12d905cb 2 bugfixes:
- Bug #985: "Between RESET SLAVE and START SLAVE, SHOW SLAVE STATUS is wrong."
Now RESET SLAVE puts correct info in mi->host etc. A new test rpl_reset_slave
for that.
- Bug #986: "CHANGE MASTER & START SLAVE do not reset error columns in SHOW
SLAVE STATUS". Now these reset the errors.
2003-08-04 10:59:44 +02:00
kostja@oak.local
50d3291aee manual merge 2003-07-31 17:11:52 +04:00
guilhem@mysql.com
df3b31f3c4 WL#1036 (print the db in slave error messages).
I extended the task to cleaning error messages, making them look nicer,
and making the output of SHOW SLAVE STATUS (column Last_error) be as complete
as what's printed on the .err file;
previously we would have, for a failure of a replicated LOAD DATA INFILE:
- in the .err, 2 lines:
"duplicate entry 2708 for key 1"
"failed loading SQL_LOAD-5-2-2.info"
- and in SHOW SLAVE STATUS, only:
"failed loading SQL_LOAD-5-2-2.info".
Now SHOW SLAVE STATUS will contain the concatenation of the 2 messages.
2003-07-24 22:25:36 +02:00
guilhem@gbichot2
9a5ac78f4c On Feb 4th, 2003, Monty said he would push my patch to print replicate-do-table
and other replicate-*-table options in SHOW SLAVE STATUS.
Seems like it had not been done, so I push it now:
there's 4 new columns to SHOW SLAVE STATUS.
2003-07-23 15:46:46 +02:00
gluh@gluh.mysql.r18.ru
333bddb33f SCRUM:
Task 499 'init_connect, init_slave options'
2003-07-18 14:11:01 +05:00
monty@narttu.mysql.fi
df7c1e8165 Better fix for bug #791: At binlog rotation, INSERTs may not find their way into the binlog 2003-07-14 14:59:26 +03:00
guilhem@mysql.com
fbebac9a48 Fix for BUG#791:
a safer way of initing the mutexes in MYSQL_LOG.
is_open() is now always thread-safe.
See each file for details.
2003-07-11 14:26:44 +02:00
monty@mashka.mysql.fi
d495656ac5 Cleanups 2003-07-09 00:55:07 +03:00
pem@mysql.telia.com
9c3a7a6ba3 Merge 4.1 into 5.0 (first pass). 2003-07-08 17:50:23 +02:00
guilhem@mysql.com
9c73d91d54 WL#912 (more user control on relay logs):
FLUSH LOGS now rotates relay logs,
and a new variable max_relay_log_size.
Plus a very small bit of code cleaning.
2003-07-06 17:59:54 +02:00
guilhem@mysql.com
ace8a06323 I committed the same changeset in my tree yesterday, but broke the tree since,
so I commit again in a fresh tree.
Fix for bug#763 (Relay_log_space too big by 4 bytes),
plus comments and DBUG_PRINT, and we don't start replication
if --bootstrap.
2003-07-03 01:08:36 +02:00
pem@mysql.com
b3f153507e Added missing (char*) casts in bzero calls.
(Needed for platforms with the traditional bzero prototype.)
Fixes BUG#460.
2003-07-03 01:08:34 +02:00
kostja@oak.local
7df0475847 First version of new authentification procedure: now authentification is one-stage (instead of two-stage in 4.1)
For now following tasks have been done:
- PASSWORD() function was rewritten. PASSWORD() now returns SHA1
  hash_stage2; for new passwords user.password contains '*'hash_stage2; sql_yacc.yy also fixed; 

- password.c: new functions were implemented, old rolled back to 4.0 state

- server code was rewritten to use new authorization algorithm (check_user(), change
  user, and other stuff in sql/sql_parse.cc)

- client code was rewritten to use new authorization algorithm
  (mysql_real_connect, myslq_authenticate in sql-common/client.c)

- now server barks on 45-byte-length 4.1.0 passwords and refuses 4.1.0-style
  authentification. Users with 4.1.0 passwords are blocked (sql/sql_acl.cc)

- mysqladmin.c was fixed to work correctly with new passwords

Tests for 4.0-4.1.1, 4.1.1-4.1.1 (with or without db/password) logons was performed;
mysqladmin also was tested. Additional check are nevertheless necessary.
2003-07-01 23:40:59 +04:00
monty@mashka.mysql.fi
048d545a58 Code/testcase cleanups 2003-07-01 13:29:55 +03:00
monty@narttu.mysql.fi
1bd306ccd4 Fixed some new memory leaks
Updated VC++ files
2003-06-24 12:10:35 +03:00
monty@narttu.mysql.fi
28e96d95c5 Simple code cleanup 2003-06-23 20:05:54 +03:00
guilhem@mysql.com
4deb135b0b Changed change_master() to use ER_MASTER_INFO (better display). 2003-06-17 23:19:38 +02:00
guilhem@mysql.com
3f33f17114 Fix for nightly build test failure (test update).
More messages.
Testcase for bug 651.
2003-06-16 15:49:54 +02:00
guilhem@mysql.com
80edc81ed0 Simplified a test.
thd->enter_cond() and exit_cond(), so that the I/O thread accepts to stop
when it's waiting for relay log space.
Reset ignore_log_space_limit to 0 when the SQL thread terminates.
2003-06-15 12:01:51 +02:00
guilhem@mysql.com
28d3c3d76f - Fix for bug 651: now a dying SQL slave threads wakes up any waiting MASTER_POS_WAIT().
Could not add a testcase for this: if the test goes into a MASTER_POS_WAIT, it waits
until this terminates (even doing "connection other_con" to launch "stop slave" is blocked).
- In MASTER_POS_WAIT() don't test if the I/O slave is running, but if the SQL thread
is running.
- Some DBUG info for this bugfix.
2003-06-14 16:40:00 +02:00
monty@narttu.mysql.fi
1e62d6070a Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into narttu.mysql.fi:/my/mysql-4.1
2003-06-14 11:38:09 +03:00
monty@narttu.mysql.fi
a1034db4b9 Cleanup after split of libmysql.c to client.c and libmysql.c. A 4.1 master/slave will now use the 4.1 protocol
Fixed wrong value for SQLSTATE_LENGTH
Added CLIENT_REMEMBER_OPTIONS to mysql_real_connect()
Changed mysql_port and mysql_unix_port to mysqld_xxxx
2003-06-14 11:37:42 +03:00
guilhem@mysql.com
cd36523784 See each file's changeset for details.
- Comments for future devs.
- Start_log_event::exec_event() : when we hit it, do a rollback.
- We don't need LOG_EVENT_FORCED_ROTATE_F.
- Stop_log_event::exec_event() : when we hit it, we needn't clean anything.
- Removed LOG_EVENT_TIME_F and LOG_EVENT_FORCED_ROTATE_F.
- We don't need Stop events in the relay log.
- Now filtering of server id is done in the I/O thread first.
2003-06-12 16:20:31 +02:00
guilhem@mysql.com
96c8d91a0c More error messages. This is intended to help debugging; presently I have a
support issue with an unclear message which can have N reasons for appearing.
This should help us know at which point it failed, and get the errno when
my_open was involved (as the reason for the unclear message is often a
permission problem).
RESET SLAVE resets last_error and last_errno in SHOW SLAVE STATUS (without this,
rpl_loaddata.test, which is expected to generate an error in last_error, influenced
rpl_log_pos.test).
A small test update.
Added STOP SLAVE to mysql-test-run to get rid of several stupid error messages
which are printed while the master restarts and the slave attempts/manages to
connect to it and sends it nonsense binlog requests.
2003-06-10 23:29:49 +02:00
guilhem@mysql.com
60fb005e5e Fix for bug 254 :
we now make a distinction between if the master is < 3.23.57, 3.23 && >=57, and 4.x
(before the 2 3.23 were one). This is because in 3.23.57 we have a way to distinguish between
a Start_log_event written at server startup and one written at FLUSH LOGS, so we
have a way to know if the slave must drop old temp tables or not.
Change: mi->old_format was bool, now it's enum (to handle 3 cases). However, functions
which had 'bool old_format' as an argument have their prototypes unchanged, because
the old old_format == 0 now corresponds to the enum value BINLOG_FORMAT_CURRENT which
is equal to 0, so boolean tests are left untouched. The only case were we use mi->old_format
as an enum instead of casting it implicitly to a bool, is in Start_log_event::exec_event,
where we want to distinguish between the 3 possible enum values.
2003-06-06 16:41:28 +02:00
guilhem@mysql.com
0058593c2d Test for bug 578. And a comment in slave.cc. 2003-06-05 17:02:00 +02:00
monty@narttu.mysql.fi
7a54334443 Merge with 4.0.13 2003-06-05 17:33:38 +03:00
monty@narttu.mysql.fi
dad0664579 merge with public tree 2003-06-05 00:12:45 +03:00
monty@narttu.mysql.fi
40109c574a Merge with 4.0.13 2003-06-04 19:21:51 +03:00
guilhem@mysql.com
4a80a6c7b9 One-line fix for bug 576 (DBUG_ASSERT failure when using CHANGE MASTER TO RELAY_LOG_POS=4).
Plus a changeset which I had committed but forgot to push (and this changeset is lost on
another computer, so I recreate it here). This changeset is "user-friendly SHOW BINLOG EVENTS
and CHANGE MASTER TO when log positions < 4 are used.
2003-06-03 23:13:06 +02:00
hf@deer.(none)
9ad3c1cdca SCRUM:
splittiln common client's parts
2003-06-03 15:02:57 +05:00
guilhem@mysql.com
4d5ae1d37c Clearer error message (in the customer's case, the relay log was corrupted,
not the master's binlog) (SW 1571).
2003-06-02 17:30:47 +02:00
hf@deer.(none)
02d3d7e8bd SCRUM:
Here is another pack of changes about gathering common client code in
sql-common/client.c.
Now i symlink the client.c from sql/ and libmysql/. These directories
have client_settings.h files to be included to client.c. It contains
defines and declarations to compile client.c in appropriate manner.
Also i've added include/sql_common.h, containing declarations of what
is exported from client.c

I removed as many #ifdef-s from client.c as i dared to. I think it's better
push it with some extra #ifdef-s now (of course, if everythihg besides it is
ok) so other people can check the code.
2003-05-31 15:15:46 +05:00
greg@mysql.com[greg]
ea46c24279 rlyon-5.0.0-alpha.patch 2003-05-29 14:28:02 -04:00
hf@deer.(none)
e5428b2fe9 Lots of conflicts resolved 2003-05-28 13:54:58 +05:00
guilhem@mysql.com
cf3cda2778 Removed bad mutex locking 2003-05-27 18:16:50 +02:00
guilhem@mysql.com
9ed9ad5374 - Fix for memory leak if the SQL slave thread is killed just after reading an event.
- A few more mutex locks and unlocks of rli.log_space_lock for doing clean reads of
rli.ignore_log_space_limit
- Broadcast after unlock, not before (small speed optimisation).
2003-05-25 23:09:46 +02:00
monty@narttu.mysql.fi
dd2b7918cd Merge with 4.0.13 2003-05-19 16:35:49 +03:00
hf@deer.mysql.r18.ru
7a7e0e1575 SCRUM
common parts of libmysql.c and sql/mini_client.cc moved to sql-common/client.c
names of functions now are same in both cases
2003-05-02 21:07:41 +05:00
pem@mysql.com
35c82164f6 Merged 4.1 to 5.0. 2003-04-29 12:06:04 +02:00
greg@mysql.com
24968f1ee3 Changes from Novell for NetWare platform 2003-04-24 20:48:54 -04:00
guilhem@mysql.com
b03ec0d7db Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
2003-04-24 15:29:25 +02:00
hf@deer.mysql.r18.ru
5d4e9f95f2 Merging 2003-04-08 19:43:24 +05:00
hf@deer.mysql.r18.ru
0428d08606 SCRUM
two KILL versions
code trimming with headquarter's suggestions
2003-04-08 19:18:33 +05:00
bar@bar.mysql.r18.ru
0002beb7a4 my_strncasecmp() is not used anymore. Use my_strncoll() instead. 2003-04-01 14:17:28 +05:00
hf@genie.(none)
0ee0589e93 Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0
into genie.(none):/home/hf/work/mysql-5.0.kil
2003-03-31 13:42:37 +05:00
hf@genie.(none)
f8f0b70380 SCRUM
two KILL commands implementation (version 2)
2003-03-31 13:39:46 +05:00
monty@narttu.mysql.fi
9f200ede0d Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into narttu.mysql.fi:/my/mysql-4.1
2003-03-20 02:06:08 +02:00
monty@narttu.mysql.fi
b883a9c01c Merge with 4.0.12 2003-03-19 22:25:44 +02:00
monty@narttu.mysql.fi
48a9c1239c Added support for ULONG division with DIV
Fixed non fatal memory leak in slave code.
2003-03-19 21:23:13 +02:00
bar@bar.mysql.r18.ru
7549a76c7c Replication were broken because of automatic charset conversion.
As a fix, my_charset_bin is now used in master-slave packets instead
of system_charset_info.
2003-03-18 11:34:19 +04:00
guilhem@mysql.com
87e1c552ed New variable rli->ignore_log_space_limit to resolve
a deadlock between I/O and SQL threads in replication
when relay_log_space is too small. This fixes bug #79.
2003-03-17 22:51:56 +01:00
monty@narttu.mysql.fi
5dd970c335 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into narttu.mysql.fi:/my/mysql-4.1
2003-03-17 15:06:06 +02:00
bar@bar.mysql.r18.ru
caf31a0790 Preparing to client<->server autoconvert 2003-03-17 13:14:04 +04:00
monty@narttu.mysql.fi
a434bca704 Merge with 4.0 2003-03-16 19:17:54 +02:00
monty@mashka.mysql.fi
8edc752573 Simple fixes (nothing notable) 2003-03-12 01:40:06 +02:00
monty@narttu.mysql.fi
fae2711297 merge 2003-03-10 14:13:46 +02:00
monty@narttu.mysql.fi
e98a4473b4 Fix that round(0.1,1) == round(0.1,1) 2003-03-10 12:00:19 +02:00
guilhem@mysql.com
c6f241636f Clearer error message when one forgot to grant REPLICATION SLAVE :
now we'll have something like this :
030308 18:46:58  Slave I/O thread: connected to master 'gb@localhost:3306',  replication started in log 'FIRST' at position 4
030308 18:46:58  While trying to obtain the list of slaves from the master 'localhost:3306', user 'gb' got the following error: 'Access denied. You need the REPLICATION SLAVE privilege for this operation'
030308 18:46:58  Slave I/O thread exiting, read up to log 'FIRST', position 4
instead of "Error updating slave list: Query error".
This fixes bug #80.
2003-03-08 18:53:32 +01:00
guilhem@mysql.com
6b4f438ddb Replication: small bug fixes in mysql-test-run.sh and in replication code (more reinitializations)
+ fix for #70 
+ test result fix for LOAD DATA LOCAL bug #82
2003-03-03 14:57:02 +01:00
guilhem@mysql.com
e66992aef5 Replication: simplification of init_relay_log_pos: always initialize,
remove variable rli->log_pos_current.
2003-03-02 00:45:19 +01:00
papa@gbichot.local
264d8c095d Replication: give the slave I/O thread a higher priority than the slave SQL thread
so that it has fetched the most from the master's binlog before the master
accidently dies. SCRUM task #756.
2003-03-01 23:59:27 +01:00
monty@narttu.mysql.fi
050543bdfc Merge with 3.23 -> 4.0 2003-02-28 13:29:48 +02:00
monty@narttu.mysql.fi
a0d2a621ed Added detection if pthread_attr_getstacksize() exists
Fixed bug in RAND() usage in mysqlbinlog
2003-02-27 17:35:51 +02:00
monty@mashka.mysql.fi
cf9668fd37 Added START TRANSACTION syntax
Added ALL as parameter option for all group functions.
Make join handling uniform. This allows us to use ',', JOIN and INNER JOIN the same way.
Sort NULL last if DESC is used (ANSI SQL 99 requirement)
2003-02-06 16:55:59 +02:00
monty@mashka.mysql.fi
023d6dd39b Merge with 4.0.11 2003-02-04 21:52:14 +02:00
monty@mashka.mysql.fi
689578a099 Fixes for Netware
Call pthread_mutex_destroy() on not used mutex.
Changed comments in .h and .c files from // -> /* */
Added detection of mutex on which one didn't call pthread_mutex_destroy()
Fixed bug in create_tmp_field() which causes a memory overrun in queries that uses "ORDER BY constant_expression"
Added optimisation for ORDER BY NULL
2003-01-28 08:38:28 +02:00