1. Fix ddl_i18n_koi8r, ddl_i18n_utf8: explicitly specify character-sets
directory for mysqldump;
2. Fix crash in mysqldump if collation is not found;
3. Use proper way to compare character set names.
- BUG#11986: Stored routines and triggers can fail if the code
has a non-ascii symbol
- BUG#16291: mysqldump corrupts string-constants with non-ascii-chars
- BUG#19443: INFORMATION_SCHEMA does not support charsets properly
- BUG#21249: Character set of SP-var can be ignored
- BUG#25212: Character set of string constant is ignored (stored routines)
- BUG#25221: Character set of string constant is ignored (triggers)
There were a few general problems that caused these bugs:
1. Character set information of the original (definition) query for views,
triggers, stored routines and events was lost.
2. mysqldump output query in client character set, which can be
inappropriate to encode definition-query.
3. INFORMATION_SCHEMA used strings with mixed encodings to display object
definition;
1. No query-definition-character set.
In order to compile query into execution code, some extra data (such as
environment variables or the database character set) is used. The problem
here was that this context was not preserved. So, on the next load it can
differ from the original one, thus the result will be different.
The context contains the following data:
- client character set;
- connection collation (character set and collation);
- collation of the owner database;
The fix is to store this context and use it each time we parse (compile)
and execute the object (stored routine, trigger, ...).
2. Wrong mysqldump-output.
The original query can contain several encodings (by means of character set
introducers). The problem here was that we tried to convert original query
to the mysqldump-client character set.
Moreover, we stored queries in different character sets for different
objects (views, for one, used UTF8, triggers used original character set).
The solution is
- to store definition queries in the original character set;
- to change SHOW CREATE statement to output definition query in the
binary character set (i.e. without any conversion);
- introduce SHOW CREATE TRIGGER statement;
- to dump special statements to switch the context to the original one
before dumping and restore it afterwards.
Note, in order to preserve the database collation at the creation time,
additional ALTER DATABASE might be used (to temporary switch the database
collation back to the original value). In this case, ALTER DATABASE
privilege will be required. This is a backward-incompatible change.
3. INFORMATION_SCHEMA showed non-UTF8 strings
The fix is to generate UTF8-query during the parsing, store it in the object
and show it in the INFORMATION_SCHEMA.
Basically, the idea is to create a copy of the original query convert it to
UTF8. Character set introducers are removed and all text literals are
converted to UTF8.
This UTF8 query is intended to provide user-readable output. It must not be
used to recreate the object. Specialized SHOW CREATE statements should be
used for this.
The reason for this limitation is the following: the original query can
contain symbols from several character sets (by means of character set
introducers).
Example:
- original query:
CREATE VIEW v1 AS SELECT _cp1251 'Hello' AS c1;
- UTF8 query (for INFORMATION_SCHEMA):
CREATE VIEW v1 AS SELECT 'Hello' AS c1;
on PPC/Debian Linux default stack size for a thread is too big.
As we use default thread settings in mysqltest, the
thread creation fails if we create lots of threads (as it
happens in flush.test). So now stack size is explicitly specified
for the mysqltest
---
Added casts and fixed wrong type.
---
Added casts and fixed wrong type.
---
Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1-marvel
into a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel
---
Don't give warning that readonly variable is forced to be readonly
mysql-test-run run now fails if we have [Warning] and [ERROR] as tags in .err file
Fixed wrong reference to the mysql manual
Fixed wrong prototype that caused some tests to fail on 64 bit platforms
---
Disabled compiler warnings mainly for Win 64.
---
Added casts to remove compiler warnings on windows
Give warnings also for safe_mutex errors found by test system
Added some warnings from different machines in pushbuild
---
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-marvel
into mysql.com:/home/my/mysql-5.1
---
Added escapes for double quotes and parenthesis.
---
Archive db fix plus added non-critical warnings
in ignore list.
---
Fixed previously added patch and added new ignored warning.
fixed by using flush logs, dumping, then doing PURGE MASTER LOGS TO 'binfile', instead
of deleting the log files at the beginning.
NOTE: previously the delete-master-logs would reset the log names back to
filename.00001. Now the trailing number doesn't get reset. This may need to be
documented.
sometimes `mysqldump --hex-blob' overruned output buffer by '\0' byte.
The dump_table() function has been fixed to reserve 1 byte more for the
last '\0' byte of dumped string.
This patch corrects a problem encountered when reading the binlog from a remote
host. The application was crashing because the buffer variable (temp_buf) in
log_event was not pointing to the incoming data. For a normal file read, this
buffer is allocated by a previous call of read_log_event. However, when reading
from a remote host, the first call to read_log_event is not executed therefore
no buffer is allocated. Furthermore, there is no need to allocate a new buffer
because the incoming stream is what needs to be read.
This patch adds the call to initialize the temp_buf variable if reading from a
remote host. It also adds a check at destroy time to ensure the temp_buf is not
freed if reading from a remote host.
mysqldump generated output that set OLD_SQL_MODE twice, to different values
(for triggers), or not at all (for routines) in some cases.
---
Merge blasphemy.mysql.com:/home/tnurnberg/28223/50-28223
into blasphemy.mysql.com:/home/tnurnberg/28223/51-28223
The following type conversions was done:
- Changed byte to uchar
- Changed gptr to uchar*
- Change my_string to char *
- Change my_size_t to size_t
- Change size_s to size_t
Removed declaration of byte, gptr, my_string, my_size_t and size_s.
Following function parameter changes was done:
- All string functions in mysys/strings was changed to use size_t
instead of uint for string lengths.
- All read()/write() functions changed to use size_t (including vio).
- All protocoll functions changed to use size_t instead of uint
- Functions that used a pointer to a string length was changed to use size_t*
- Changed malloc(), free() and related functions from using gptr to use void *
as this requires fewer casts in the code and is more in line with how the
standard functions work.
- Added extra length argument to dirname_part() to return the length of the
created string.
- Changed (at least) following functions to take uchar* as argument:
- db_dump()
- my_net_write()
- net_write_command()
- net_store_data()
- DBUG_DUMP()
- decimal2bin() & bin2decimal()
- Changed my_compress() and my_uncompress() to use size_t. Changed one
argument to my_uncompress() from a pointer to a value as we only return
one value (makes function easier to use).
- Changed type of 'pack_data' argument to packfrm() to avoid casts.
- Changed in readfrm() and writefrom(), ha_discover and handler::discover()
the type for argument 'frmdata' to uchar** to avoid casts.
- Changed most Field functions to use uchar* instead of char* (reduced a lot of
casts).
- Changed field->val_xxx(xxx, new_ptr) to take const pointers.
Other changes:
- Removed a lot of not needed casts
- Added a few new cast required by other changes
- Added some cast to my_multi_malloc() arguments for safety (as string lengths
needs to be uint, not size_t).
- Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done
explicitely as this conflict was often hided by casting the function to
hash_get_key).
- Changed some buffers to memory regions to uchar* to avoid casts.
- Changed some string lengths from uint to size_t.
- Changed field->ptr to be uchar* instead of char*. This allowed us to
get rid of a lot of casts.
- Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar
- Include zlib.h in some files as we needed declaration of crc32()
- Changed MY_FILE_ERROR to be (size_t) -1.
- Changed many variables to hold the result of my_read() / my_write() to be
size_t. This was needed to properly detect errors (which are
returned as (size_t) -1).
- Removed some very old VMS code
- Changed packfrm()/unpackfrm() to not be depending on uint size
(portability fix)
- Removed windows specific code to restore cursor position as this
causes slowdown on windows and we should not mix read() and pread()
calls anyway as this is not thread safe. Updated function comment to
reflect this. Changed function that depended on original behavior of
my_pwrite() to itself restore the cursor position (one such case).
- Added some missing checking of return value of malloc().
- Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow.
- Changed type of table_def::m_size from my_size_t to ulong to reflect that
m_size is the number of elements in the array, not a string/memory
length.
- Moved THD::max_row_length() to table.cc (as it's not depending on THD).
Inlined max_row_length_blob() into this function.
- More function comments
- Fixed some compiler warnings when compiled without partitions.
- Removed setting of LEX_STRING() arguments in declaration (portability fix).
- Some trivial indentation/variable name changes.
- Some trivial code simplifications:
- Replaced some calls to alloc_root + memcpy to use
strmake_root()/strdup_root().
- Changed some calls from memdup() to strmake() (Safety fix)
- Simpler loops in client-simple.c
mysqldump didn't properly handle getting no data on
SHOW CREATE PROCEDURE. If S/C/P fails (due to dumping
user's insufficient privileges on mysql.proc, say),
mysqldump will print a comment to that effect to the
output and return an error-code. If the -f (force) option
is used, the dump will continue, otherwise, it will abort
right there and then.
Also fixes Bug#22761, "mysqldump reports no errors when using
--routines without mysql.proc privileges"
---
Merge mysql.com:/home/tnurnberg/27293/50-27293
into mysql.com:/home/tnurnberg/27293/51-27293
---
Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into mysql.com:/home/tnurnberg/27293/51-27293
mysqldump didn't properly handle getting no data on
SHOW CREATE PROCEDURE. If S/C/P fails (due to dumping
user's insufficient privileges on mysql.proc, say),
mysqldump will print a comment to that effect to the
output and return an error-code. If the -f (force) option
is used, the dump will continue, otherwise, it will abort
right there and then.
Also fixes Bug#22761, "mysqldump reports no errors when using
--routines without mysql.proc privileges"
---
Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into mysql.com:/home/tnurnberg/27293/50-27293
- Added script to generate application specific manifest.
- Added new CMake MACRO to add customer build events which will first
generate a manifest and then embeds that manifest into an executable.
- Improve mysql_upgrade and add comments describing it's logic
- Don't look for mysql and mysqlcheck randomly, use dir where mysql_upgrade
was started from
- Don't look for mysql_fix_privilege_tables.sql randomly, compile
in the mysql_fix_privilege_tables.sql file and use that to upgrade
the system tables of MySQL
- Check for any unexpected error returned from runnning the mysql_fix_privilege_tables SQL
- Fix bug#26639, bug#24248 and bug#25405
(Removes some warnings about UNIX_TIMESTAMP from the slave.err logs)
Marked federated_server as a '--big-test'
Change error in net_clear to 'Note', as it interfered with mysql-test-run.
Change to use remove_file instead of 'system rm' in a lot of tests. (Should fix some windows test problems)
Removed memory leak in mysql_test if sync_with_master fails.
Do not terminate ndb_cluster_binary_log before the util thread has finnished. This should fix a shutdown bug where a thread is accessing injector_mutex after it's freed.
Patch may fix Bug#27622 "mysqld shutdown, util thread continues, while binlog thread exits"
bug #27715: mysqld --character-sets-dir buffer overflow
bug ##26851: Mysql Client --pager Buffer Overflow
Using strmov() to copy an argument may cause overflow
if the argument's length is bigger than the buffer:
use strmake instead.
Also, we have to encrease the error message buffer size to fit
the longest message.
Taking code from before BUG#22583 and incorporating as events to be able
to read old events. Also incorporating old pack and unpack functions
into patch.
- Giving the directive '--all-databases' to mysqldump caused
an attempt to lock and dump log tables which don't support this
operation.
- With this patch the log tables are excluded from the set of
databases tables to dump.
Adding an event that can be used to denote that an incident occured
on the master. The event can be used to denote a gap in the replication
stream, but can also be used to denote other incidents.
In addition, the injector interface is extended with functions to
generate an incident event. The function will also rotate the binary
log after generating an incident event to get a fresh binary log.
Add the --skip-write-binlog option, which adds NO_WRITE_TO_BINLOG
to REPAIR, ANALYZE, and OPTIMIZE commands.
Use this option when these SQL commands should not be sent to
replication slaves, nor run when using the binary logs for recovery
from backup
- Interpret the pointer passed to 'mysql_options' for
MYSQL_OPT_SSL_VERIFY_SERVER_CERT as a my_bool
- In 5.1 the mysql_options signature will be chanegd to take
a 'void*' in order to further emphasize the need for a pointer
to correct type