Fixed the 5.0-bugteam MacOSX warnings.
client/mysqldump.c:
Bug #45286: typecasts
cmd-line-utils/readline/bind.c:
Bug #45286: use variable of right type
cmd-line-utils/readline/display.c:
Bug #45286: use variable of right type
dbug/user.r:
Bug #45286: no warnings in generating man pages
strings/ctype.c:
Bug #45286: typecasts
The fix is to use case insensitive collation
for mysql client command search.
client/mysql.cc:
The fix is to use case insensitive collation
for mysql client command search.
mysql-test/r/mysql.result:
test result
mysql-test/t/mysql.test:
test case
mysqldump --tab still dumped triggers to stdout rather than to
individual tables.
We now append triggers to the .sql file for the corresponding
table.
--events and --routines correspond to a database rather than a
table and will still go to stdout with --tab unless redirected
with --result-file (-r).
client/mysqldump.c:
Extend open_sql_file_for_table() so we can open-append.
Change dump_triggers_for_table() so it will append its
output to the table's .sql-file when --tab is used.
mysql-test/r/mysqldump.result:
Show that when using --tab, triggers now end up in the .sql
file with the corresponding table (after that table), while
--routines and --events go to stdout or --result-file.
mysql-test/t/mysqldump.test:
Show that when using --tab, triggers now end up in the .sql
file with the corresponding table (after that table), while
--routines and --events go to stdout or --result-file.
Dump all connection-related arguments when running mysqlcheck
from mysql_upgrade.
No test case, since the output depends on the test suite
configuration and platform.
client/mysql_upgrade.c:
Dump all connection-related arguments when running mysqlcheck
from mysql_upgrade.
The --hexdump option crashed mysqlbinlog when used together
with the --read-from-remote-server option due to use of
uninitialized memory.
Since Log_event::print_header() relies on temp_buf to be
initialized when the --hexdump option is present,
dump_remote_log_entries() was fixed to setup temp_buf to point
to the start of a binlog event as done in
dump_local_log_entries().
The root cause of this bug is identical to the one for
bug #17654. The latter was fixed in 5.1 and up, so this
patch is backport of the patches for bug #17654 to 5.0.
Only 5.0 needs a changelog entry.
client/mysqlbinlog.cc:
Fixed dump_remote_log_entries() so that temp_buf is initialized
as it may be used later by Log_event::print_header() if the
--hexdump option is present.
mysql-test/r/mysqlbinlog.result:
Added a test case for bug #41943.
mysql-test/t/mysqlbinlog.test:
Added a test case for bug #41943.
When the thread executing a DDL was killed after finished its
execution but before writing the binlog event, the error code in
the binlog event could be set wrongly to ER_SERVER_SHUTDOWN or
ER_QUERY_INTERRUPTED.
This patch fixed the problem by ignoring the kill status when
constructing the event for DDL statements.
This patch also included the following changes in order to
provide the test case.
1) modified mysqltest to support variable for connection command
2) modified mysql-test-run.pl, add new variable MYSQL_SLAVE to
run mysql client against the slave mysqld.
When asking what database is selected, client expected
to *always* get an answer from the server.
We now handle failure more gracefully.
See comments in ticket for a discussion of what happens,
and how things interlock.
client/mysql.cc:
Handle empty result-sets gracefully, as opposed
to just result sets with n>0 items that may themselves
be empty.
mysql-client used static buffer to concatenate server-
version and version_comment. Sufficiently long comments
could get cut off. This was harmless, but looked daft.
Now using a dynamic buffer instead.
client/mysql.cc:
Use dynamic rather than static buffer for server
information. If we can get both version and comment,
concat them and use that. Otherwise, try to use just
version. If that fails too, return empty string so
overly trusting callers do not crash. Release memory
as needed.
When loading dump created by mysqldump tool an error is
thrown saying storage engine for the table doesn't have
an option.
mysqldump tries to re-insert the data into the federated
table which causes the error. Since the data is already
available on the remote server, mysqldump shouldn't try
to dump the data again for FEDERATED tables.
As stated in the bug page, it can be considered similar
to the MERGE ENGINE with "view only" nature.
Fixed by adding the "FEDERATED ENGINE" to the exception
list to ignore the data.
client/mysqldump.c:
Fixed check_if_ignore_table() to ignore FEDERATED engine
when dumping the table data.
mysql-test/r/federated.result:
Result file for BUG#21360
mysql-test/t/federated.test:
Testcase for BUG#21360
~40Mb after mysqldump/import
When the input string exceeds the maximum allowed size for the
internal buffer, batch_readline() returns a truncated string.
Since there was no way for a caller to determine whether the
string was truncated or not, the command line client assumed
batch_readline() to always return the whole input string and
appended a newline character. This resulted in garbled data
when importing dumps containing strings longer than the
maximum input buffer size.
Fixed by adding a flag to the batch_readline() interface to
signal a truncated string to the caller.
Other minor problems fixed during patch implementation:
- The maximum allowed buffer size for batch_readline() was set
up depending on the client's max_allowed_packet value. It does
not actully make any sense, as those variables are not
related. The input buffer size limit is now always set to 1
MB.
- fill_buffer() did not always set the EOF flag.
- The input buffer could actually grow twice as the specified
limit due to insufficient checks in intern_read_line().
client/my_readline.h:
Changed the interface of batch_readline().
client/mysql.cc:
Honor the truncated flag returned by batch_readline() and do
not append the newline character if it was set. Since we can't
change the interfaces for readline()/fgets() used in the
interactive mode, always assume the returned string was not
truncated. In addition, always set the batch_readline()
internal buffer to 1 MB, independently from the client's
max_allowed_packet.
client/readline.cc:
Added the 'truncated' argument do batch_readline() to signal
truncated string to a caller.
Fixed fill_buffer() to set the EOF flag correctly.
Fixed checks in intern_read_line() to not allow the internal
buffer grow past the specified limit.
mysql-test/r/mysql.result:
Added a test case for bug #41486.
mysql-test/t/mysql.test:
Added a test case for bug #41486.