WL#5182 is a follow-up to WL#5154, deprecating a few more options
and system variables.
client/client_priv.h:
The warning message has been changed to not include
a specific version number in the text.
client/mysql.cc:
--no-tee is deprecated
client/mysqldump.c:
--all is deprecated
-a now points to create-options
mysql-test/r/mysqlbinlog.result:
Warning text changed
mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result:
Warning text changed
sql/mysql_priv.h:
The warning message has been changed to not include
a specific version number in the text.
sql/mysqld.cc:
--use-symbolic-links is deprecated
-s now points to --symbolic-links
--warnings is deprecated
-W now points to --log-warnings
myisam_max_extra_sort_file_size is deprecated
record_buffer is deprecated
--log-update is deprecated
--sql-bin-update-same is deprecated
--skip-locking is deprecated
--skip-symlink is deprecated
--enable-locking is deprecated
--delay-key-write-for-all-tables is deprecated
Several items said to be deprecated in the 4.1 manual
have never been removed. This worklog adds deprecation
warnings when these items are used, and warns the user
that the items will be removed in MySQL 5.6.
A couple of previously deprecation decision have been
reversed (see single file comments)
client/client_priv.h:
Macro similar to the one in the server (mysql_priv.h)
for printing a deprecation warning message
client/mysql.cc:
no-auto-rehash will not be deprecated
skip-line-numbers will not be deprecated
skip-column-names will not be deprecated
no-pager is deprecated
set-variable is deprecated
no-named-commands is deprecated
client/mysqladmin.cc:
set-variable is deprecated
client/mysqlbinlog.cc:
position is deprecated
client/mysqldump.c:
first-slave is deprecated
no-set-names is deprecated
set-variable is deprecated
mysql-test/r/mysqlbinlog.result:
Adding the [Warning] to the test case, just to show that the
deprecation works.
The test case will be changed in Celosia to use --start-position.
mysys/my_getopt.c:
set-variable (include -O) is deprecated
scripts/mysqld_multi.sh:
Warning for mysqld_multi
sql/mysqld.cc:
default-collation is deprecated
log-bin-trust-routine-creators is deprecated
set-variable is deprecated
default-character-set is deprecated
safe-show-database is deprecated
sql/share/errmsg.txt:
Added version number for sql_log_update deprecation message.
The problem is a somewhat common misusage of the strmake function.
The strmake(dst, src, len) function writes at most /len/ bytes to
the string pointed to by src, not including the trailing null byte.
Hence, if /len/ is the exact length of the destination buffer, a
one byte buffer overflow can occur if the length of the source
string is equal to or greater than /len/.
client/mysqldump.c:
Make room for the trailing null byte.
libmysql/libmysql.c:
Add comment, there is enough room in the buffer.
Increase buffer length, two strings are concatenated.
libmysqld/lib_sql.cc:
Make room for the trailing null byte.
mysys/default.c:
Make room for the trailing null bytes.
mysys/mf_pack.c:
Make room for the trailing null byte.
server-tools/instance-manager/commands.cc:
Copy only if overflow isn't possible in both cases.
server-tools/instance-manager/listener.cc:
Make room for the trailing null byte.
sql/log.cc:
Make room for the trailing null byte.
sql/sp_pcontext.h:
Cosmetic fix.
sql/sql_acl.cc:
MAX_HOSTNAME already specifies space for the trailing null byte.
sql/sql_parse.cc:
Make room for the trailing null byte.
sql/sql_table.cc:
Make room for the trailing null byte.
strmov() is not guaranteed to work correctly on overlapping
source and destination buffers. On some OSes it may work,
but Fedora 12 has a stpcpy() that's not working correctly
on overlapping buffers.
Fixed to use the overlap-safe version of strmov instead.
Re-vitalized the overlap-safe version of strmov.
"mysql_upgrade (ver 5.1) add 3 fields to mysql.proc table but does
not set values".
mysql_upgrade (ver 5.1) adds 3 fields (character_set_client,
collation_connection and db_collation) to the mysql.proc table, but
does not set any values. When we run stored procedures, which were
created with mysql 5.0, a warning is logged into the error log.
The solution to this is for mysql_upgrade to set default best guess
values for these fields. A warning is also written during upgrade, to
make the user aware that default values are set.
client/mysql_upgrade.c:
Result lines which start with "WARNING" are passed through to the output.
This way we have a way of triggering WARNING-messages during upgrade
directly from the .sql-script.
mysql-test/r/mysql_upgrade.result:
Expected result of the test.
mysql-test/t/mysql_upgrade.test:
Added a test-case for the bug.
scripts/mysql_system_tables_fix.sql:
The new fields are populated, and warnings are written.
mysql client displays wrong character-set of server. When a user changes the
charset of a server, mysql client 'status' command displays wrong charset but
the command "SHOW VARIABLES LIKE "%charset%" displayed correct charset results.
The problem is only with the mysql client's 'status' command output.
In mysql client, the method mysql_store_lazy_result() returns 0 for
success and non-zero for failure. The method com_status() was using this method
wrongly. Fixed all such instances according to return value of the method
mysql_store_lazy_result().
client/mysql.cc:
Fix for BUG#47671 - wrong character-set after upgrade from 5.1.34 to 5.1.39
Fix com_status() method to use mysql_store_lazy_result() properly.
mysql-test/r/bug47671.result:
Fix for BUG#47671 - wrong character-set after upgrade from 5.1.34 to 5.1.39
Testcase for BUG#47671
mysql-test/t/bug47671-master.opt:
Fix for BUG#47671 - wrong character-set after upgrade from 5.1.34 to 5.1.39
Testcase for BUG#47671
mysql-test/t/bug47671.test:
Fix for BUG#47671 - wrong character-set after upgrade from 5.1.34 to 5.1.39
Testcase for BUG#47671
When starting the (5.1+) mysql command-line client, we try to get
"select @@version_comment" from the server to present it to the
user. Recent clients are aware that older servers do not have that
variable and fall back on other info to be able to present *something*
at least. This fallback string was allocated through the POSIX interface,
but released through the my*() suite, which rightfully complained about
the imbalance in calls when compiled with --debug. While this wasn't
as bad as it looked (no double-free, use of uninitialized or freed
buffer, etc.), it did look funky.
Using my_strdup() now for what will be my_free()d later.
client/mysql.cc:
Use my_strdup() for server_version, as we'll my_free() it later
and don't want to upset the mysql client's memory accounting.
The reason for the bug is that mysqtest as well as other client tools
running in test suite (mysqlbinlog, mysqldump) will first try to connect
whatever database has created shared memory with default base name
"MySQL" and use this. (Same effect could be seen on Unix if mtr would
not care to calculate "port" and "socket" parameter).
The fix ensures that all client tools and running in mtr use unique
per-database shared memory base parameters, so there is no possibility
to clash with already installed one. We use socket name for shared memory
base (it's known to be unique). This shared-memory-base is written to the
MTR config file to the [client] and [mysqld] sections. Fix made also made
sure all client tools understand and correctly handle --shared-memory-base.
Prior to this patch it was not the case for mysqltest, mysqlbinlog and
mysql_client_test.
All new connections done from mtr scripts via connect() will by default
set shared-memory-base. And finally, there is a possibility to force
shared memory or pipe connection and overwrite shared memory/pipe base name
from within mtr scripts via optional PIPE or SHM modifier. This functionality
was manually backported from 6.0
(original patch http://lists.mysql.com/commits/74749)
If a thread is killed in the server, we throw "shutdown" only if one is actually in
progress; otherwise, we throw "query interrupted".
Control-C in the mysql command-line client is "incremental" now.
First Control-C sends KILL QUERY (when connected to 5.0+ server, otherwise, see next)
Next Control-C sends KILL CONNECTION
Next Control-C aborts client.
As the first two steps only pertain to an existing query,
Control-C will abort the client right away if no query is running.
client will give more detailed/consistent feedback on Control-C now.
client/mysql.cc:
Extends Control-C handling; enhances up feedback to user.
On 5.0+ servers, we try to be nice and send KILL QUERY first
if Control-C is pressed in the command-line client, but if
that doesn't work, we now give the user the opportunity to
send KILL CONNECTION with another Control-C (and to kill the
client with another Control-C if that somehow doesn't work
either).
mysql-test/t/flush_read_lock_kill.test:
we're getting correct "thread killed" rather than
"in shutdown" error now
mysql-test/t/kill.test:
we're getting correct "thread killed" rather than
"in shutdown" error now
mysql-test/t/rpl000001.test:
we're getting correct "thread killed" rather than
"in shutdown" error now
mysql-test/t/rpl_error_ignored_table.test:
we're getting correct "thread killed" rather than
"in shutdown" error now
sql/records.cc:
make error messages on KILL uniform for rr_*()
by folding that handling into rr_handle_error()
sql/sql_class.h:
Only throw "shutdown" when we have one flagged as being in progress;
otherwise, throw "query interrupted" as it's likely to be "KILL CONNECTION"
or related.
There are some problems about help text:
- It is stated that "auto" is the default twice. It need be stated only once.
- It is stated that --base64-output is short for --base64-output=always. But that sounds
like the default is "always", not "auto".
Make the help text clear as following:
Determine when the output statements should be base64-encoded BINLOG
statements: 'never' disables it and works only for binlogs without
row-based events; 'auto' prints base64 only when necessary (i.e.,
for row-based events and format description events); 'always' prints
base64 whenever possible. 'always' is for debugging only and should
not be used in a production system. If this argument is not given,
the default is 'auto'; if it is given with no argument, 'always' is used.
The 'BEGIN/COMMIT/ROLLBACK' log event could be filtered out if the
database is not selected by --database option of mysqlbinlog command.
This can result in problem if there are some statements in the
transaction are not filtered out.
To fix the problem, mysqlbinlog will output 'BEGIN/ROLLBACK/COMMIT'
in regardless of the database filtering rules.
client/mysqlbinlog.cc:
Skip the database check for BEGIN/COMMIT/ROLLBACK log events.
mysql-test/r/mysqlbinlog.result:
Test result for bug#46998
mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_db_filter.test:
The test case is updated duo to the patch of bug#46998
mysql-test/t/mysqlbinlog.test:
Added test to verify if the 'BEGIN', 'COMMIT' and 'ROLLBACK' are output
in regardless of database filtering
The 'BEGIN/COMMIT/ROLLBACK' log event could be filtered out if the
database is not selected by --database option of mysqlbinlog command.
This can result in problem if there are some statements in the
transaction are not filtered out.
To fix the problem, mysqlbinlog will output 'BEGIN/ROLLBACK/COMMIT'
in regardless of the database filtering rules.
client/mysqlbinlog.cc:
Skip the database check for BEGIN/COMMIT/ROLLBACK log events.
mysql-test/r/mysqlbinlog.result:
Test result for bug#46998
mysql-test/t/mysqlbinlog.test:
Added test to verify if the 'BEGIN', 'COMMIT' and 'ROLLBACK' are output
in regardless of database filtering
All statements executed by mysql_upgrade are binlogged and then are replicated to slave.
This will result in some errors. The report of this bug has demonstrated some examples.
Master and slave should be upgraded separately. All statements executed by
mysql_upgrade will not be binlogged.
--write-binlog and --skip-write-binlog options are added into mysql_upgrade.
These options control whether sql statements are binlogged or not.
Option "--without-server" still not working in 5.1
The general approach is to make sure that source files
which require thread support are only compiled if the build
really needs thread support,
which means when the server is built or a thread-safe client
library.
This required several changes:
- Make sure the subdirectories "storage/" and "plugin/" are
only processed if the server is built, not ifclient-only.
- Make the compilation of some modules which inherently
require threading depend on thread supportin the build.
- Separate the handling of threading in "configure.in" from
that of server issues, threading is also needed in a
non-server build of a thread-safe client library.
Also, "libdbug" must get built even in a client-only build,
so "dbug/" must be in the list of client directories.
In addition, calls to thread functions in source files which
can be built without thread support must use the wrapper
functions which handle the non-threaded build.
So the modules "client/mysqlimport.c" and "client/mysqlslap.c"
must call "my_thread_end()" only via "mysql_thread_end()".
Makefile.am:
The directories "storage/" and "plugin/" contain files
which are needed for the server only, so their contents
is to be built only if a server is built.
They must not be named unconditionally, because building
their contents will fail unless threads are enabled.
These directories are now listed in the "configure"
variable "sql_server_dirs" which becomes part of
"sql_union_dirs" if the server is to be built.
client/mysqlimport.c:
Use the wrapper function "mysql_thread_end()" which
correctly handles the case of a non-threaded build.
client/mysqlslap.c:
Use the wrapper function "mysql_thread_end()" which
correctly handles the case of a non-threaded build.
configure.in:
Various changes to support builds "--without-server":
1) For the unit tests, we need "libdbug".
2) Separate the treatment of the server from that of the
thread-safe client library.
3) Introduce an "automake conditional" "NEED_THREAD"
which can be checked in some "Makefile.am".
4) Include "storage/" and "plugin/" in the list of
"sql_server_dirs" so that they are handled in the
top "Makefile.am" only if the server is to be built
(see the change in that file).
mysys/Makefile.am:
The code of "mf_keycache.c" in 5.1 is no longer safe
to be built without thread support.
(In 5.0, this was possible.)
Rather than fix these issues, which is tedious and risky,
avoid the need to ever build it without thread support:
It is needed in the server only, which needs thread support.
The only case where we build a "libmysys" without thread
support is for a non-threaded client, where "mf_keycache"
is not neded.
So its inclusion in the list of source files can depend
on the new conditional "NEED_THREAD".
unittest/mysys/Makefile.am:
Test program "my_atomic-t" is to verify the correct handling
of threads only, it cannot be built without thread support
and is not needed in such cases either.
Let its build depend on the new conditional "NEED_THREAD".
for CREATE TABLE...LIKE...
Add my_sync.c to mysqltest sources list in CMakeLists.txt
client/CMakeLists.txt:
BUG#46591 - .frm file isn't sync'd with sync_frm enabled
for CREATE TABLE...LIKE...
Add my_sync.c to mysqltest sources list
CREATE TABLE...LIKE...
The mysql server option 'sync_frm' is ignored when table is created with
syntax CREATE TABLE .. LIKE..
Fixed by adding the MY_SYNC flag and calling my_sync() from my_copy() when
the flag is set.
In mysql_create_table(), when the 'sync_frm' is set, MY_SYNC flag is passed
to my_copy().
Note: TestCase is not attached and can be tested manually using debugger.
client/Makefile.am:
BUG#46591 - .frm file isn't sync'd with sync_frm enabled for
CREATE TABLE...LIKE...
add my_sync to sources as it is used in my_copy() method
include/my_sys.h:
BUG#46591 - .frm file isn't sync'd with sync_frm enabled for
CREATE TABLE...LIKE...
MY_SYNC flag is added to call my_sync() method
mysys/my_copy.c:
BUG#46591 - .frm file isn't sync'd with sync_frm enabled for
CREATE TABLE...LIKE...
my_sync() is method is called when MY_SYNC is set in my_copy()
sql/sql_table.cc:
BUG#46591 - .frm file isn't sync'd with sync_frm enabled for
CREATE TABLE...LIKE...
Fixed mysql_create_like_table() to call my_sync() when opt_sync_frm variable
is set