Don't start the SQL slave thread with SQL_BIG_SELECTS;
it's better to inhibate max_join_size instead.
sql/slave.cc:
OPTION_BIG_SELECTS does more than ignoring max_join_size (talks to the optimiser),
just ignore max_join_size.
sql/slave.h:
comments
Fixed deadlock bug when doing resize of key buffer while key buffer was in active use
myisam/mi_locking.c:
Better fix for myisamchk --sort-index on windows
mysql-test/r/symlink.result:
Update results
mysql-test/t/symlink.test:
Update results
mysys/mf_keycache.c:
Fixed deadlock bug when doing resize of key buffer while key buffer was in active use
sql/ha_myisam.cc:
simple optimization
sql/sql_show.cc:
Fixed theoretical buffer overrun
Reset variable properly before calling update_create_info()
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".
sql/log.cc:
MYSQL_LOG::wait_for_update() is used by the binlog_dump and I/Oslave threads,
and it updates thd->proc_info, so we need a bool to not show the same
proc_info for 2 different things (previously we showed "Slave: etc" and that's
bad for a binlog_dump thread).
sql/slave.cc:
Clearer thd-proc_info for slave threads.
sql/sql_class.h:
prototype change
sql/sql_repl.cc:
clearer thd->proc_info for binlog_dump thread
Fix unlock error in myisamchk on windows when doing --sort-index
Use SetFilePointer instead of SetFilePointerEx
VC++Files/client/mysql.dsp:
Update of project files
VC++Files/client/mysqladmin.dsp:
Update of project files
VC++Files/client/mysqlclient.dsp:
Update of project files
VC++Files/client/mysqldump.dsp:
Update of project files
VC++Files/client/mysqlimport.dsp:
Update of project files
VC++Files/client/mysqlshow.dsp:
Update of project files
VC++Files/comp_err/comp_err.dsp:
Update of project files
VC++Files/innobase/innobase.dsp:
Update of project files
VC++Files/isamchk/isamchk.dsp:
Update of project files
VC++Files/libmysql/libmysql.dsp:
Update of project files
VC++Files/libmysqld/libmysqld.dsp:
Update of project files
VC++Files/libmysqltest/myTest.dsp:
Update of project files
VC++Files/my_print_defaults/my_print_defaults.dsp:
Update of project files
VC++Files/myisamlog/myisamlog.dsp:
Update of project files
VC++Files/mysql.dsw:
Update of project files
VC++Files/mysqlbinlog/mysqlbinlog.dsp:
Update of project files
VC++Files/mysqlcheck/mysqlcheck.dsp:
Update of project files
VC++Files/mysqldemb/mysqldemb.dsp:
Update of project files
VC++Files/mysqlmanager/MySqlManager.dsp:
Update of project files
VC++Files/mysqlserver/mysqlserver.dsp:
Update of project files
VC++Files/mysqlshutdown/mysqlshutdown.dsp:
Update of project files
VC++Files/mysys/mysys.dsp:
Update of project files
VC++Files/pack_isam/pack_isam.dsp:
Update of project files
VC++Files/perror/perror.dsp:
Update of project files
VC++Files/replace/replace.dsp:
Update of project files
VC++Files/sql/mysqld.dsp:
Update of project files
VC++Files/test1/test1.dsp:
Update of project files
VC++Files/thr_test/thr_test.dsp:
Update of project files
VC++Files/vio/vio.dsp:
Update of project files
VC++Files/zlib/zlib.dsp:
Update of project files
myisam/mi_check.c:
Fix unlock error in myisamchk on windows when doing --sort-index
myisam/mi_locking.c:
Fix unlock error in myisamchk on windows when doing --sort-index
myisam/myisamchk.c:
New comment
mysys/my_chsize.c:
Use SetFilePointer instead of SetFilePointerEx, as the first is more portable
sql/handler.cc:
Fix compiler warning
sql/log_event.cc:
Fix compiler warning
OPTION_BIG_SELECTS.
sql/slave.cc:
The slave threads MUST not care about max_join_size.
I can imagine the case of a slave where users can connect and do SELECTs, but
DBA does not want them to issue crazy SELECTs, but he/she still wants replication
to work.
Before, this just printed a warning to the error log (not fatal) but that
was still annoying.
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.
sql/log_event.cc:
Detect the case where the master died while flushing the binlog cache to the binlog:
in that case, we have a BEGIN with no COMMIT/ROLLBACK in the relay log; we detect
this with rli->inside_transaction in Rotate_log_event::exec_event() (which is the
only right place to detect this, see comments). When we see it, we stop with error.
In 4.1, I had put code in Start_log_event::exec_event(); I'll remove it next time
I push in the 4.1 tree.
sql/slave.cc:
* Use slave_print_error instead of sql_print_error, to put the info in SHOW SLAVE STATUS too.
* Fix for a potential bug:
when the SQL thread stops, set rli->inside_transaction to 0. This is not needed if
replication later restarts from the same position; but this is needed if the user
restarts replication from a completely different place where there are only autocommit
statements (in that case, if we didn't set to 0, the position would never increment in SHOW
SLAVE STATUS, even if queries are processed well).
mysql-test/r/func_test.result:
Auto merged
mysql-test/r/grant.result:
Auto merged
mysql-test/t/func_test.test:
Auto merged
mysql-test/t/grant.test:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
fix for BUG#1113 "INSERT into non-trans table SELECT ; ROLLBACK" does not send warning"
and
fix for BUG#873 "In transaction, INSERT to non-trans table is written too early to binlog".
Now we don't always write the non-trans update immediately to the binlog;
if there is something in the binlog cache we write it to the binlog cache
(because the non-trans update could depend on a trans table which was modified
earlier in the transaction); then in case of ROLLBACK, we write the binlog
cache to the binlog, wrapped with BEGIN/ROLLBACK.
This guarantees that the slave does the same updates.
For ROLLBACK TO SAVEPOINT: when we execute a SAVEPOINT command we write it
to the binlog cache. At ROLLBACK TO SAVEPOINT, if some non-trans table was updated,
we write ROLLBACK TO SAVEPOINT to the binlog cache; when the transaction
terminates (COMMIT/ROLLBACK), the binlog cache will be flushed to the binlog
(because of the non-trans update) so we'll have SAVEPOINT and ROLLBACK TO
SAVEPOINT in the binlog.
Apart from this rare case of updates of mixed table types in transaction, the
usual way is still clear the binlog cache at ROLLBACK, or chop it at
ROLLBACK TO SAVEPOINT (meaning the SAVEPOINT command is also chopped, which
is fine).
Note that BUG#873 encompasses subbugs 1) and 2) of BUG#333 "3 binlogging bugs when doing INSERT with mixed InnoDB/MyISAM".
client/mysqldump.c:
Minor edit: one CHANGE MASTER with 2 arguments instead of 2 CHANGE MASTER with one argument each.
mysql-test/r/rpl_loaddata.result:
result update
mysql-test/t/rpl_loaddata.test:
minor edit: simplifying the test.
sql/handler.cc:
Fix for BUG#873. See comments in code, and the description of the changeset.
sql/log.cc:
* Previously, if a query updated a non-transactional table we wrote it immediately
to the real binlog. This causes a bug when the update is done inside a transaction
and uses the content of an updated transactional table (because this makes
a wrong order of queries in the binlog). So if the binlog cache is not empty,
we write the query to the binlog cache; otherwise we can write it to the binlog.
* Previously, when we flushed the binlog cache to the binlog, we wrapped it
with BEGIN/COMMIT. Now it's also possible to wrap it with BEGIN/ROLLBACK, to handle
transactions which update both transactional and non-transactional tables.
sql/log_event.cc:
The slave thread can leave a transaction if COMMIT or if ROLLBACK.
sql/sql_class.h:
prototype
sql/sql_insert.cc:
Fix for BUG#1113:
this was because the INSERT SELECT code did not set OPTION_STATUS_NO_TRANS_UPDATE.
sql/sql_parse.cc:
Don't send ER_WARNING_NOT_COMPLETE_ROLLBACK if this is the SQL slave thread (see comments).
client/mysqltest.c:
Fix that LET can be used with queries that return multiple columns
libmysql/errmsg.c:
Extend socket name to 100 characters in error messages
libmysql/libmysql.c:
Reset some variables to make ensure that we can call mysql_server_init()/mysql_server_end() many times
mysql-test/mysql-test-run.sh:
Set open-files-limit to 1024
mysql-test/r/loaddata.result:
Add test case for LOAD DATA bug report (was not a bug)
mysql-test/r/query_cache.result:
Move test with many tables to separate test
mysql-test/r/select_safe.result:
Make test repeatable
mysql-test/t/loaddata.test:
Add test case for LOAD DATA bug report (was not a bug)
mysql-test/t/query_cache.test:
Move test with many tables to separate test
mysql-test/t/select_safe.test:
Make test repeatable
sql/field.cc:
Portability fix for gcc 3.3
sql/mysqld.cc:
Store in open_files_limit the true number of files we can open (if system supports it)
sql/sql_load.cc:
Safety fix
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.
sql/slave.cc:
Enabling again process_io_create_file
"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.
mysql-test/r/rpl_loaddata.result:
Test that logging of LOAD DATA INFILE is done on the slave
mysql-test/t/rpl_loaddata.test:
Test that logging of LOAD DATA is done on the slave
sql/log.cc:
debug info
sql/log_event.cc:
* Append_block, Exec_load and Delete_file now have a member 'db' like Create_file.
This member is filled by mysql_load(). It is used for filtering by binlog-*-db rules,
that's all. It's not written to the binlog, and so can't be read from the binlog.
In other words, that's temporary info which is stored in the event and lost when
it is written and deleted.
* Better error messages in Append_block et al. events.
* The slave now logs (log-slave-updates) the Create_file et al. events in mysql_load()
(they are not directly copied from the events in the relay log, because this
prevented filtering by binlog-*-db rules). Before, mysql_load() in the slave
did no logging, now it does the logging, as in any regular thread.
sql/log_event.h:
New member 'db' for Append_block et al. events.
sql/slave.cc:
Removed useless code. Why was it useless:
- CREATE_FILE_EVENT is not defined in 3.23. It appeared in 4.0.
- in queue_old_event(), which is called only if the master is 3.23, we had a
case CREATE_FILE_EVENT:
so this case can be removed.
- this case was the only caller of process_io_create_file() so this function
can be removed.
sql/sql_load.cc:
Pass the db to events, so that they can be well filtered.
sql/sql_repl.cc:
Pass the db to events so that they can be well filtered.
Set min value of max_allowed_packet to 1024
Fixed problem with UNION's without braces and SQL_CALC_FOUND_ROWS, LIMIT #,#
and ORDER BY...LIMIT
include/m_string.h:
Added memcpy_overlap() to avoid warnings when using valgrind on memcpy(A,A,...)
myisam/mi_create.c:
Fixed comment
myisam/mi_search.c:
Fix warning from valgrind
myisam/mi_write.c:
Indentation fix
mysql-test/mysql-test-run.sh:
Add options handled by general skip- option
mysql-test/r/packet.result:
Update results after change to mysqld (min max_allowed_packet length is now 1024)
mysql-test/r/union.result:
Added testing of UNION with SQL_CALC_FOUND_ROWS
mysql-test/t/packet.test:
Update results after change to mysqld (min max_allowed_packet length is now 1024)
mysql-test/t/union.test:
Added testing of UNION with SQL_CALC_FOUND_ROWS
sql/field.cc:
Fix to remove waarning from valgrind
sql/ha_innodb.cc:
Remove wrong include file
sql/item_cmpfunc.cc:
Safety fix to handle EOM conditions in IN
sql/item_sum.cc:
Fixed prototype for update_field() (argument was alwys 0)
sql/item_sum.h:
Fixed prototype for update_field() (argument was alwys 0)
sql/item_uniq.h:
Fixed prototype for update_field() (argument was alwys 0)
sql/log.cc:
Indentation fix
sql/mysqld.cc:
Set min value of max_allowed_packet to 1024 (to avoid it getting set to 0)
sql/net_serv.cc:
Indentation changes + trivial optimization
sql/sql_select.cc:
Fixed prototype for update_field() (argument was alwys 0)
sql/sql_union.cc:
Fixed problem with UNION's without braces and
- SQL_CALC_FOUND_ROWS
- LIMIT #,#
- ORDER BY ... LIMIT
Fix for a bug with LEAST() in WHERE clause
ha_innodb.cc:
Fix for a configure bug
multi_update.result, multi_update.test:
Fix for the update with NULL's in the result set
sql_update.cc:
Fix for the update with NULL's in the result set
Fix for the update with NULL's in the result set
Fix for the update with NULL's in the result set
sql/sql_update.cc:
Fix for the update with NULL's in the result set
Fix for the update with NULL's in the result set
Fix for the update with NULL's in the result set
mysql-test/t/multi_update.test:
Fix for the update with NULL's in the result set
mysql-test/r/multi_update.result:
Fix for the update with NULL's in the result set
sql/ha_innodb.cc:
Fix for a configure bug
sql/item_func.h:
Fix for a bug with LEAST() in WHERE clause
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)
mysql-test/r/rpl_log.result:
SHOW BINLOG EVENTS for binlog on slave should give the same
Orig_log_pos and Pos values
sql/log_event.cc:
Do not propagate our master's log pos to our bin log
sql/repl_failsafe.cc:
Added comment about broken SHOW NEW MASTER
sql/slave.cc:
Do not propagate our master's log pos to our bin log
sql/sql_class.cc:
THD::log_pos is no longer needed
sql/sql_class.h:
THD::log_pos is no longer needed
sql/sql_parse.cc:
Added comment about broken SHOW NEW MASTER
the first 4 bytes of the relay log. Indeed comments in mysys/mf_iocache.c
say we must always use my_b_append for such a cache.
This *could* avoid a very rare assertion failure which is:
030524 19:32:38 Slave SQL thread initialized, starting replication in log 'FIRST' at position 0, relay log '/
users/gbichot/4.1.1/mysql-test/var/log/slave-relay-bin.000001' position: 4
030524 19:32:38 next log '/users/gbichot/4.1.1/mysql-test/var/log/slave-relay-bin.000002' is currently active
mysqld: mf_iocache.c:701: _my_b_seq_read: Assertion `pos_in_file == info->end_of_file' failed.
and which seemed to happen always when the SQL thread and/or the I/O thread
were at position 4 in a relay log.
include/my_sys.h:
moving a function from log_event.cc so that it can be widely used
mysys/mf_iocache.c:
moving a function from log_event.cc so that it can be widely used
sql/log.cc:
my_b_write should not be used on a SEQ_READ_APPEND cache, one should use my_b_append
(otherwise there could be some locking problems).
sql/log_event.cc:
moved to mysys/mf_iocache.c for wider use.
A typo.
"mysqlbinlog does not comment the original LOAD DATA INFILE if it has a "use xx""
client/mysqlbinlog.cc:
a comment
sql/log_event.cc:
in mysqlbinlog we want to have a leading '#' before LOAD DATA INFILE when we
print a Create_file event.
This was not done properly when the query had *2* lines: only the "use db" got
commented.
To fix this I had to add an argument to Load_log_event::print, it could not be
handled in Create_file_log_event::print alone.
sql/log_event.h:
prototype
Fix packet error when using wrong GRANT command
include/config-win.h:
Changed back to test for HAVE_SETFILEPOINTER instead of operating system
mysql-test/r/grant.result:
Extra test to catch wrong packet bug
mysql-test/t/grant.test:
Extra test to catch wrong packet bug
mysys/my_chsize.c:
Cleanup
sql/opt_range.cc:
Fix to recent BETWEEN patch
sql/sql_acl.cc:
Fix packet error when using wrong GRANT command
sql/sql_select.cc:
Cleanups
Added not critical out-of-memory check
Fix possible replication bug with LOAD DATA ... IGNORE LINES #
mysql-test/r/rpl_log.result:
Test of load data ... ignore # lines
mysql-test/t/rpl_log.test:
Test of load data ... ignore # lines
sql/log_event.cc:
Fix replication bug with LOAD DATA ... IGNORE LINES #
(Note that the code that is probably not executed in 4.0)
sql/sql_parse.cc:
Indentation fix
sql/sql_select.cc:
Remove wrong bug fix (all tests passes)
sql/sql_yacc.yy:
Indentation cleanup
removed unused field (now it is in variables)
mysql-test/r/query_cache.result:
rewritten test using loop
mysql-test/t/query_cache.test:
rewritten test using loop
sql/sql_class.h:
removed unused field (now it is in variables)
(Mostly code cleanups)
include/my_sys.h:
Removed not used define
myisam/mi_check.c:
Indentation change
mysql-test/t/rpl_insert_id.test:
Add test if server supports innodb
mysys/mf_format.c:
Remove QUOTE handling from fn_format()
(fn_format() should not have anything to do with quoting things)
sql/log_event.cc:
Removed some unnecessary casts (by changing functions to use const char *)
Cleaned up some error messages to make them shorter and (hopefully) more readable.
Fixed wrong format strings
Restored 'thd->options' on error.
sql/mini_client.cc:
Changed order of include files to remove compilation warning
sql/mysqld.cc:
Add proper quoting of service arguments (don't use fn_format)
sql/slave.cc:
Simple optimization and cleanup.
Changed rewrite_db() and print_slave_db_safe() to use const char* to avoid casting of arguments when calling functions.
Cleanup of some error messages.
sql/slave.h:
Changed protypes to use const char *
sql/sql_acl.cc:
Simple optimization
vio/viosslfactories.c:
Changed order of include files to remove compilation warning
- 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.
mysql-test/r/rpl_loaddata.result:
result update.
mysql-test/t/rpl_loaddata.test:
Test that RESET SLAVE, START SLAVE and CHANGE MASTER all reset
Last_slave_error and Last_slave_errno (columns of SHOW SLAVE STATUS).
We do it in this test because that's one of tests which have
an intentional query error on the slave.
sql/slave.cc:
As we need TWICE the code to copy command-line options (--master-host etc)
to mi (we already had it in init_master_info, but we also need it in RESET
SLAVE to fix bug#985), I make a function of this code.
And a function to reset Last_slave_error and Last_slave_errno (we need
it in CHANGE MASTER, RESET SLAVE, and at the start of the SQL thread).
sql/slave.h:
declarations for new functions.
sql/sql_repl.cc:
copy --master-host etc to mi in RESET SLAVE, so that SHOW SLAVE STATUS
shows correct information.
replicate-*-table rules which exclude 'mysql' tables
(e.g. replicate-wild-ignore-table=mysql.%).
This was already the behaviour for GRANT/REVOKE, I'm extending it to
SET PASSWORD because it seems very logical (the contrary seems illogical).
2 new tests:
- one to test if GRANT and SET PASSWORD are replicated
- one to test if they are not replicated if replicate-wild-ignore-table=mysql.%
The 2nd is also a testcase for BUG#980.
sql/sql_acl.cc:
Fix so that SET PASSWORD is not replicated by the slave if running with
replicate-*-table rules which exclude 'mysql' tables
(e.g. replicate-wild-ignore-table=mysql.%).
This was already the behaviour for GRANT/REVOKE, I'm extending it to
SET PASSWORD because it seems very logical (the contrary seems illogical).
tables_ok() does not ignore them. This fixes random bug #980.
sql/sql_acl.cc:
Mark tables 'updating' so that tables_ok() does not ignore them;
this fixes random bug #980.
the bug with 3.23.
ChangeSet@1.1416.113.1, 2003-03-22 15:22:59+01:00, guilhem@mysql.com
Fix for #178 Replicating INSERT VALUES(USER()) crashes (SEGV) the slave
Now it does not SEGV, but USER() is still badly replicated
(it is replicated to ""), which is a lower priority bug.
sql/item_strfunc.cc:
Don't segfault in USER() if thd->user == 0 (system thread).
mysql-test/r/query_cache.result:
test of many merged tales
mysql-test/t/query_cache.test:
test of many merged tales
sql/sql_cache.h:
query with merged tables can depend of more then 255 tables
ignorant about ssl_type attribute
sql/sql_acl.cc:
Now acl_getroot() honors ssl_type attribute even if we compile without openssl
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
innodb_fast_shutdown CAN take an argument though it was not specified so in mysqld.cc
sql/mysqld.cc:
innodb_fast_shutdown CAN take an argument though it was not specified so in mysqld.cc
binary logging.
sql/repl_failsafe.cc:
If the master is running without --log-bin, SHOW MASTER STATUS will return
"empty set", i.e. row==0; we must test this before invoking row[0], or
segfault.
just a flush_relay_log_info() at the end of CHANGE MASTER
(there was already flush_master_info()).
sql/sql_repl.cc:
Comments.
Flush relay-log.info after CHANGE MASTER, or the changes
to the relay log parameters (relay log name and position, and
the corresponding master's binlog name and position) will be
lost if the slave mysqld is shutdown immediately after the
CHANGE MASTER (without the slave threads being started).
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.
sql/log_event.cc:
Print the default database when replication stops because of an error. Previously, we had:
"error "Duplicate entry 87987 for key 1", query 'insert into t values(87987)'", ie the db
was not mentioned, making it hard for cases where the same table name is used in
several databases.
Lengthened some error messages (for failing replication of LOAD DATA: mention the table
and the db).
Changes so that SHOW SLAVE STATUS reports as complete errors as the .err file.
sql/slave.cc:
Removed a useless declaration (the rewrite_db() function is already declared in slave.h).
Added missing ')' in error messages.
Tried to make error messages look nicer (previously we had
"do START SLAVE;, error_code=1062"
now we'll have
"do START SLAVE; . Error_code=1062".
This form has been discussed, I agree it's no panacea, but it's still more readable
like this. To be improved in the future :)
sql/slave.h:
declarations.
myisam/mi_locking.c:
Here we use F_EXTRA_LCK
myisam/myisamchk.c:
lines of "locking - emulation" replaced with mi_lock_database call
myisam/myisamdef.h:
no need for MI_TEMPORARY_TABLE
sql/ha_myisam.cc:
We use F_WRLCK instead MI_TEMPORARY_TABLE
myisam/mi_check.c:
Fixed memory overrun in _mi_put_key_in_record
myisam/mi_key.c:
Fixed unnecessary memory allocation
mysql-test/r/insert_select.result:
Added test case for memory corruption
mysql-test/t/insert_select.test:
Added test case for memory corruption
mysys/safemalloc.c:
Removed compiler warnings
sql/sql_acl.cc:
Fixed core dump when running with --debug
myisammrg/myrg_open.c:
never mark merge table as readonly even if all underlying myisam tables are readonly,
otherwise ALTER TABLE merge UNION=(t1,t2,t3,...) will not work
sql/handler.cc:
map EACCES to ER_OPEN_AS_READONLY.
can only happen on modifying merge table that has (some) read-only myisam tables
Fixed test for binary build
mysql-test/r/rpl_max_relay_size.result:
Fixed test for binary build
mysql-test/t/rpl_max_relay_size.test:
Fixed test for binary build
sql/log.cc:
Fixed wrong test in close
Revert the previous patch: MySQL would not allow creation of VARCHAR columns whose total max length is > 8000 bytes, though InnoDB can easily store them as trailing spaces are removed
sql/ha_innodb.h:
Revert the previous patch: MySQL would not allow creation of VARCHAR columns whose total max length is > 8000 bytes, though InnoDB can easily store them as trailing spaces are removed
Fix wrong error message: If one tried to create table with a very big row len, MySQL claimed the max len is 64 kB for InnoDB, while it normally is 8000 bytes
sql/ha_innodb.h:
Fix wrong error message: If one tried to create table with a very big row len, MySQL claimed the max len is 64 kB for InnoDB, while it normally is 8000 bytes
mysql-test/t/rpl_flush_log_loop.test:
Add timer to avoid problem when 'flush logs' is executed before we have read all data from master
sql/log.cc:
Better fix for bug #791:
Mark log as LOG_TO_BE_OPENED instead of LOG_CLOSED when it's closed and opened.
sql/mysqld.cc:
Better startup message
sql/slave.cc:
Fix argument to close()
sql/sql_class.h:
Better handling of log.close()
Monty revoked any locks for temporary tables in
ha_myisam::external_lock()
But further code bans using write cache on nonlocked tables
this makes operations much slower
myisam/mi_locking.c:
Handling of MI_TEMPORARY_TABLE lock
myisam/myisamdef.h:
defining of MI_TEMPORARY_TABLE
sql/ha_myisam.cc:
now we lock temporary tables using MI_TEMPORARY_TABLE lock
Changed is_open() to work as before.
Added back inited argument to LOG
mysql-test/r/rpl_flush_log_loop.result:
Fixed results (probably bug in previous rpatch)
sql/handler.cc:
Changed is_open() to work as before
sql/item_func.cc:
Changed is_open() to work as before
sql/log.cc:
Part revert of previous patch.
The reason for adding back 'inited' is that is that we can't be 100 % sure that init_pthread_objects() is called before mysqld dies (for example on windows)
I removed mutex lock handling in is_open() as the new code didn't have ANY affect except beeing slower.
Added back checking of is_open() to some functions as we don't want to do a mutex lock when we are not using logging.
Indentation/comment fixes
sql/log_event.cc:
Changed is_open() to work as before
sql/repl_failsafe.cc:
Changed is_open() to work as before
sql/sql_base.cc:
Changed is_open() to work as before
sql/sql_class.h:
Changed is_open() to work as before. Added back 'inited' variable
sql/sql_db.cc:
Changed is_open() to work as before
sql/sql_delete.cc:
Changed is_open() to work as before
sql/sql_insert.cc:
Changed is_open() to work as before
sql/sql_load.cc:
Changed is_open() to work as before
sql/sql_parse.cc:
Changed is_open() to work as before
sql/sql_rename.cc:
Changed is_open() to work as before
sql/sql_repl.cc:
Changed is_open() to work as before
sql/sql_table.cc:
Changed is_open() to work as before
sql/sql_update.cc:
Changed is_open() to work as before
sql/sql_repl.cc:
In my previous change I removed 'no_rotate' from MYSQL_LOG, so this made
LOG_INFO_PURGE_NO_ROTATE useless (an error code which was never returned),
so I remove it of the 'switch'.
sql/log.cc:
Member no_rotate of MYSQL_LOG is useless; this shows it for sure:
[guilhem@gbichot2 mysql-4.0]$ bk -r grep no_rotate
sql/log.cc 1.83 no_rotate(0), need_start_event(1)
sql/log.cc 1.75 if (no_rotate)
sql/log.cc 1.89 if (!no_rotate)
sql/sql_class.h 1.119 bool no_rotate;
i.e. no_rotate is 0 all the time. So we don't need it.
Biggest part of the patch is indentation change.
sql/sql_class.h:
suppress no_rotate
sql/log.cc:
a comment for the future.
sql/mysqld.cc:
if (p) is not needed: fn_ext() always returns a valid pointed; the way
to test if an extension was found is if (*p), not if (p).
But here even if there's no extension, we still want to truncate opt_name
to FN_REFLEN, so we always execute the code.
By design, the test was always 'false' (because we strip the extension before
testing if there's an extension) so log->set_no_rotate never executed.
sql/sql_class.h:
remove set_no_rotate as we don't need it.
a safer way of initing the mutexes in MYSQL_LOG.
is_open() is now always thread-safe.
See each file for details.
sql/handler.cc:
is_open() with locks
sql/item_func.cc:
is_open() with locks
sql/log.cc:
No more 'inited'.
We now always use is_open() in a thread-safe manner.
This simplifies some functions (no more need to test is_open() twice).
sql/log_event.cc:
is_open() with locks
sql/mysqld.cc:
Init mutexes for the global MYSQL_LOG objects.
We care about no_rotate, because we can't do it in open() anymore (because
we don't have 'inited' anymore).
sql/repl_failsafe.cc:
is_open() with locks
sql/slave.cc:
init pthread objects (mutexes, conds) in the constructor of st_relay_log_info.
Some better locking in rotate_relay_log().
sql/sql_base.cc:
is_open() with locks
sql/sql_class.h:
Before, we inited LOCK_log in MYSQL_LOG::open(), so in other places of the code
when we were never 100% sure that it had been inited. For example, if the server
was running without --log-bin, ::open() was not called so the mutex was not
inited. We could detect it with !inited, but not safely as 'inited' was not
protected by any mutex.
So now:
we *always* init the LOCK_log mutex, even if the log is not used. We can't init
the mutex in MYSQL_LOG's constructor, because for global objects like
mysql_bin_log, mysql_log etc, the constructor is called before MY_INIT(), but
safe_mutex depends on MY_INIT(). So we have a new function MYSQL_LOG::init_pthread_objects
which we call in main(), after MY_INIT().
For the relay log, we call this function in the constructor of
st_relay_log_info, which is called before any function tries to
use the relay log (the relay log is always invoked as rli.relay_log).
So now we should be safe in all cases and we don't need 'inited'.
sql/sql_db.cc:
is_open() with locks
sql/sql_delete.cc:
is_open() with locks
sql/sql_insert.cc:
is_open() with locks
sql/sql_load.cc:
is_open() with locks
sql/sql_parse.cc:
is_open() with locks
sql/sql_rename.cc:
is_open() with locks
sql/sql_repl.cc:
is_open() with locks
sql/sql_table.cc:
is_open() with locks
sql/sql_update.cc:
is_open() with locks
Removed double my_thread_end() which caused fatal error on windows if mysqld died on startup
myisam/mi_extra.c:
Fixed bug in ALTER TABLE ... DISABLE/ENABLE KEYS
mysql-test/r/alter_table.result:
Fixed bug in ALTER TABLE ... DISABLE/ENABLE KEYS
mysql-test/t/alter_table.test:
Test DISABLE/ENABLE KEY
sql/ha_myisam.cc:
Fixed bug in ALTER TABLE ... DISABLE/ENABLE KEYS
sql/mysqld.cc:
Removed double my_thread_end() which caused fatal error on windows if mysqld died on startup
sql/sql_table.cc:
Fixed bug in ALTER TABLE ... DISABLE/ENABLE KEYS
sql/table.cc:
Fixed bug in ALTER TABLE ... DISABLE/ENABLE KEYS
sql/table.h:
Fixed bug in ALTER TABLE ... DISABLE/ENABLE KEYS
BUG#797 "If query ignored on slave (replicate-ignore-table) the slave still checks if
the returned error (0) is the same as the one on the master, whereas it shouldn't
test this.
Plus a new test for BUG#797.
include/mysqld_error.h:
New error code (can be sent only to the slave thread, not to normal clients).
sql/log.cc:
removed comment from a previous debugging.
sql/log_event.cc:
ER_SLAVE_IGNORED_TABLE is an ignorable error.
sql/share/czech/errmsg.txt:
for BUG#797
sql/share/danish/errmsg.txt:
for BUG#797
sql/share/dutch/errmsg.txt:
for BUG#797
sql/share/english/errmsg.txt:
for BUG#797
sql/share/estonian/errmsg.txt:
for BUG#797
sql/share/french/errmsg.txt:
for BUG#797
sql/share/german/errmsg.txt:
for BUG#797
sql/share/greek/errmsg.txt:
for BUG#797
sql/share/hungarian/errmsg.txt:
for BUG#797
sql/share/italian/errmsg.txt:
for BUG#797
sql/share/japanese/errmsg.txt:
for BUG#797
sql/share/korean/errmsg.txt:
for BUG#797
sql/share/norwegian-ny/errmsg.txt:
for BUG#797
sql/share/norwegian/errmsg.txt:
for BUG#797
sql/share/polish/errmsg.txt:
for BUG#797
sql/share/portuguese/errmsg.txt:
for BUG#797
sql/share/romanian/errmsg.txt:
for BUG#797
sql/share/russian/errmsg.txt:
for BUG#797
sql/share/slovak/errmsg.txt:
for BUG#797
sql/share/spanish/errmsg.txt:
for BUG#797
sql/share/swedish/errmsg.txt:
for BUG#797
sql/share/ukrainian/errmsg.txt:
for BUG#797
sql/sql_parse.cc:
when in sql_parse in the slave thread we ignore the query because of replicate-do
and replicate-ignore options, we return a specific error to the slave thread,
so that it knows that the query has been ignored (which is different from a
successful query).
A small cleanup (test was done twice).
Fix bug: if a DELETE failed in a FOREIGN KEY error and it had already deleted some rows, then MySQL did not roll back the failed SQL statement, and also wrote it to the binlog
sql/sql_delete.cc:
Fix bug: if a DELETE failed in a FOREIGN KEY error and it had already deleted some rows, then MySQL did not roll back the failed SQL statement, and also wrote it to the binlog
FLUSH LOGS now rotates relay logs,
and a new variable max_relay_log_size.
Plus a very small bit of code cleaning.
libmysqld/lib_sql.cc:
open_log has no default arguments anymore.
mysql-test/r/rpl_flush_log_loop.result:
result update now that FLUSH LOGS rotates relay logs.
mysql-test/r/rpl_log.result:
result update now that FLUSH LOGS rotates relay logs.
mysql-test/r/rpl_rotate_logs.result:
result update now that max_binlog_size is 4096.
mysql-test/t/rpl_rotate_logs-master.opt:
now max_binlog_size must be a multiple of 4096 (see change in mysqld.cc)
sql/log.cc:
Got rid of default arguments of various MYSQL_LOG methods (the default arguments
made code reading uneasy).
Set max_size in ::init().
New function set_max_size() to set max_size of a MYSQL_LOG on-the-fly.
More DBUG info.
sql/mysql_priv.h:
no defaults in open_log().
New variables max_relay_log_size.
sql/mysqld.cc:
New variable and option max_relay_log_size.
max_binlog_size and max_relay_log_size are multiples of IO_SIZE.
No more default arguments for log functions.
sql/set_var.cc:
New variable max_relay_log_size.
If it is 0, then max_binlog_size will apply to relay logs.
When one of these variables is changed, fix_max_%log_size is called
to update max_size of the binary and/or relay logs.
sql/slave.cc:
New function rotate_relay_log().
sql/slave.h:
New function rotate_relay_log().
sql/sql_class.h:
New member max_size of MYSQL_LOG (for automatic rotation).
New method set_max_size() for setting on-the-fly.
sql/sql_parse.cc:
Flush the relay log in FLUSH LOGS.
mysql-test/r/handler.result:
test case for the bug #787: HANDLER without INDEX doesn't work with deleted rows
mysql-test/t/handler.test:
test case for the bug #787: HANDLER without INDEX doesn't work with deleted rows
sql/sql_handler.cc:
fix for the bug #787: HANDLER without INDEX doesn't work with deleted rows
Added MAX_PASSWORD_LENGTH. This increased master-slave passwords to 32 bytes (Bug #766)
Fixed server crash on purge master logs or show master logs when binlog is off. (Bug #733)
client/mysql.cc:
status query on killed mysql connection results in segmentation fault (Bug #738)
configure.in:
Portability fix for Unixware
include/my_global.h:
Removed wrong patch from previous changeset
sql/mysql_priv.h:
Added MAX_PASSWORD_LENGTH. This increased master-slave passwords to 32 bytes
sql/slave.h:
Optimized structure
sql/sql_repl.cc:
Memory overrun safety fixes (not critical)
Fixed server crash on purge master logs or show master logs when binlog is off. (Bug #733)
sql/sql_repl.h:
Fixed to use right define
strings/strmake.c:
Fixed comment
Since the mysql interactive client or some other phase in communication cuts > 64 kB strings to very short, restrict the output of SHOW INNODB STATUS to at most 60 kB
sql/ha_innodb.cc:
Since the mysql interactive client or some other phase in communication cuts > 64 kB strings to very short, restrict the output of SHOW INNODB STATUS to at most 60 kB
Remove potential starvation of a full log buffer flush: only flush up to the lsn which was the largest at the time when we requested the full log buffer flush
os0sync.h, os0sync.c:
Fix a bug in os_event on Unix: even though we signaled the event, some threads could continue waiting if the event became nonsignaled quickly again; this made group commit less efficient than it should be
innobase/os/os0sync.c:
Fix a bug in os_event on Unix: even though we signaled the event, some threads could continue waiting if the event became nonsignaled quickly again; this made group commit less efficient than it should be
innobase/include/os0sync.h:
Fix a bug in os_event on Unix: even though we signaled the event, some threads could continue waiting if the event became nonsignaled quickly again; this made group commit less efficient than it should be
innobase/log/log0log.c:
Remove potential starvation of a full log buffer flush: only flush up to the lsn which was the largest at the time when we requested the full log buffer flush
innobase/include/log0log.h:
Remove potential starvation of a full log buffer flush: only flush up to the lsn which was the largest at the time when we requested the full log buffer flush
innobase/srv/srv0srv.c:
Remove potential starvation of a full log buffer flush: only flush up to the lsn which was the largest at the time when we requested the full log buffer flush
innobase/row/row0mysql.c:
Remove potential starvation of a full log buffer flush: only flush up to the lsn which was the largest at the time when we requested the full log buffer flush
innobase/trx/trx0trx.c:
Remove potential starvation of a full log buffer flush: only flush up to the lsn which was the largest at the time when we requested the full log buffer flush
sql/ha_innodb.cc:
Remove potential starvation of a full log buffer flush: only flush up to the lsn which was the largest at the time when we requested the full log buffer flush
innobase/btr/btr0btr.c:
Remove potential starvation of a full log buffer flush: only flush up to the lsn which was the largest at the time when we requested the full log buffer flush
check for negative count in RPAD added
mysql-test/r/func_str.result:
Appropriate result
mysql-test/t/func_str.test:
testcase added
sql/item_strfunc.cc:
we return NULL if count < 0
Remove unaligned warnings on Ia64 from client library when using --host
Fix for replication when using many file descriptors
include/my_global.h:
Fix for UNIXWARE 7
libmysql/libmysql.c:
Portability fix (removes unaligned warnings on Ia64)
mysql-test/r/symlink.result:
Updated results
sql/mini_client.cc:
Ported connect timeout code from libmysql.c
Fields in key_expr (mysql_ha_read) wasn't linked to tables.
Hmm. How did it work at all?
mysql-test/r/alias.result:
It's better to delete table after the test
mysql-test/r/handler.result:
appropriate result
mysql-test/t/alias.test:
it's better to drop table after test
mysql-test/t/handler.test:
test case for #751
sql/sql_handler.cc:
fix_fields called
into narttu.mysql.fi:/my/mysql-4.0
mysql-test/r/innodb.result:
Auto merged
mysql-test/t/innodb.test:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
Tests cleanup (put drop database first in tests)
client/mysql.cc:
Cleanup of code in last pull
include/config-win.h:
Remove HAVE_CHSIZE on windows as it's not 64 bit clean
include/my_global.h:
Portability fix
mysql-test/r/drop.result:
Clean up results
mysql-test/r/flush.result:
Clean up results
mysql-test/r/grant_cache.result:
Clean up results
mysql-test/r/innodb.result:
Clean up results
mysql-test/r/insert_select.result:
Clean up results
mysql-test/r/merge.result:
Clean up results
mysql-test/r/query_cache.result:
Clean up results
mysql-test/t/drop.test:
Clean up tests
mysql-test/t/flush.test:
Clean up tests
mysql-test/t/grant_cache.test:
Clean up tests
mysql-test/t/innodb.test:
Clean up tests
mysql-test/t/insert_select.test:
Added more tests
mysql-test/t/merge.test:
Test of bug 515
mysql-test/t/query_cache.test:
Clean up tests
mysql-test/t/symlink.test:
Clean up tests
sql/mysql_priv.h:
Cleaner implementation if INSERT ... SELECT with same tables
sql/sql_lex.h:
Cleaner implementation if INSERT ... SELECT with same tables
sql/sql_list.h:
Indentation cleanup
sql/sql_parse.cc:
Cleaner implementation if INSERT ... SELECT with same tables
sql/sql_yacc.yy:
Cleaner implementation if INSERT ... SELECT with same tables
Current table is placed into read_tables set of the current join_tab->select
so get_mm_parts function thinks that current table's record is read and
tries to calculate WHERE condition with the fields of the record.
Result of these calculations is unpredictable.
Looks funny - outcome of the SELECT depends on the queries executed before.
Anyway i think we should have testcase on this part of the code.
mysql-test/r/sel000001.result:
appropriate result added
mysql-test/t/sel000001.test:
testcase added
sql/sql_select.cc:
I think we should count current table out of read_tables set
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.
mysql-test/r/rpl_log.result:
Result update
mysql-test/r/rpl_log_pos.result:
Result update
sql/mysqld.cc:
Don't start replication if in bootstrap mode (bootstrap isn't supposed to have
several threads).
sql/slave.cc:
Fix for bug 763 (Relay_log_space too big by 4 bytes).
A DBUG_PRINT.
sql/sql_acl.cc:
Replaced a return by DBUG_RETURN (happened to find this reading a debug log).
sql/sql_repl.cc:
A comment.