Bug#13238 mysqldump and mysqladmin hangs
Avoid recursion into init_available_charsets.
Serg's version didn't work for me: I got
double mutex locking.
Pushing this version instead
(It was approved by Serg anyway)
mysys/charset.c:
Bug#13238 mysqldump and mysqladmin hangs
Avoid recursion into init_available_charsets.
Serg's version didn't work for me: I got
double mutex locking.
Pushing this version instead
(It was approved by Serg anyway)
include/my_sys.h:
Fixes from review (use version in log_event.cc instead)
mysql-test/r/ctype_cp932.result:
Updated test for bug#11338 (logging of prepared statement w/ blob type)
mysql-test/t/ctype_cp932.test:
udpated test for bug#11338 (logging of prepared statement w/ blob type)
mysys/charset.c:
Fixes from review (use version in log_event.cc instead)
sql/item.cc:
Fixes from review (store character_set_client differently so that
fix can be merged forward to 5.0)
sql/item.h:
Fixes from review
sql/log_event.cc:
Fixes from review, str_to_hex is now used by item.cc
sql/log_event.h:
Added prototype for str_to_hex (now used by item.cc)
sql/sql_prepare.cc:
Fixes from review, store character_set_client differently so that
Item_param::query_val_str can use it.
In cp932, '\' character can be the second byte in a
multi-byte character stream. This makes it difficult to use
mysql_escape_string. Added flag to indicate which languages allow
'\' as second byte of multibyte sequence so that when putting a prepared
statement into the binlog we can decide at runtime whether hex encoding
is really needed.
include/m_ctype.h:
Added bool to indicate character sets which allow '\' as the second
byte of a multibyte character set (currently only cp932). For these
character sets, escaping with '\' is dangerous and leads to corruption
in replication.
include/my_sys.h:
Add function to enocde a string as hex with no prefix (bare)
mysys/charset.c:
Add function to encode string as hex with no prefix (bare).
sql/item.cc:
Check the connection character set to see if escape_string_for_mysql
is safe, or if character set requires unambiguous (hex) encoding
sql/item.h:
Pass thd to query_val_str for access to charset()
sql/sql_prepare.cc:
Pass thd to query_val_str.
strings/ctype-big5.c:
Add escape_with_backslash_is_dangerous flag.
strings/ctype-bin.c:
Add escape_with_backslash_is_dangerous flag
strings/ctype-cp932.c:
Add escape_with_backslash_is_dangerous flag.
strings/ctype-czech.c:
Add escape_with_backslash_is_dangerous flag.
strings/ctype-euc_kr.c:
Add escape_with_backslash_is_dangerous flag.
strings/ctype-extra.c:
Add escape_with_backslash_is_dangerous flag.
strings/ctype-gb2312.c:
Add escape_with_backslash_is_dangerous flag.
strings/ctype-gbk.c:
Added escape_with_backslash_is_dangerous flag.
strings/ctype-latin1.c:
Added escape_with_backslash_is_dangerous flag.
strings/ctype-sjis.c:
Added escape_with_backslash_is_dangerous flag.
strings/ctype-tis620.c:
Added esacpe_with_backslash_character_is_dangerous flag.
strings/ctype-uca.c:
Added escape_with_backslash_is_dangerous flag.
strings/ctype-ucs2.c:
Added escape_with_backslash_is_dangerous.
strings/ctype-ujis.c:
Added escape_with_backslash_is_dangerous flag.
strings/ctype-utf8.c:
Added escape_with_backslash_is_dangerous.
strings/ctype-win1250ch.c:
Added escape_with_backslash_is_dangerous.
(important for Adobe).
mf_pack.c, mf_dirname.c, charset.c, my_sys.h:
- adding fs_character_set() function on Windows
- ignoring fake slashes which are just multibyte
parts in several functions in /mysys
Verified by Shu to work on WinXP and Win2k.
Test is not possible, or very hard to do.
include/my_sys.h:
Bug#5439 : mysql_server_init() crashes if ShiftJIS path is passed
(important for Adobe)
- adding fs_character_set() function on Windows
- ignoring fake slashes which are just multibyte
parts in several functions in /mysys
mysys/charset.c:
d
mysys/mf_dirname.c:
d
mysys/mf_pack.c:
d
Bug#12109 possible locking bug in init_available_charset
Recheck charset_initialized inside locked code,
to garantee two threads are not entering
consequently.
mysys/charset.c:
Bug#12109 possible locking bug in init_available_charset
Recheck charset_initialized inside locked code,
to garantee two threads are not entering
consequently.
What we need to be able to set in myisamchk is
actually a collation, not a character set. This
fix just changes to display the proper error message.
include/mysys_err.h:
New mysys error message "unknown collation".
mysys/charset.c:
Display more proper error when a collation is not found.
mysys/errors.c:
New "unknown collation" error.
Treat unknown characters straight in a query as syntax error, rather skipping it as a space character.
mysys/charset.c:
Treat unknown characters straight in a query as syntax error, rather skipping it as a space character.
mysql-test/t/ctype_latin1.test:
Treat unknown characters straight in a query as syntax error, rather skipping it as a space character.
mysql-test/r/ctype_latin1.result:
Treat unknown characters straight in a query as syntax error, rather skipping it as a space character.
a multibyte character, but was not a valid multibyte character. Refinement
of fix for Bug #8378.
tests/mysql_client_test.c:
Fix test (and fix number) for Bug #8378
mysys/charset.c:
Fix to only escape the first character in a sequence that appears
to be a multibyte character, but was not a valid one.
a character that appears to be a multi-byte character based on its first
byte, but is not actually a valid multi-byte character. (Bug #8378)
tests/mysql_client_test.c:
Add test for Bug #8317
mysys/charset.c:
Properly escape invalid multibyte characters.
- A new flag MY_CS_CSSORT was introduced for case sensitivity.
- Item_func_regexp doesn't substiture ICASE not only
for binary collations but for case sensitive collations as well.
- mutex was unlocked before the end of the critical sesion,
- Portability issue: It's better to use (*alloc)(x) instead of alloc(x),
if alloc is a function passed as an argument.
- Use {} around if() block, to avoid possible problems with some Windows compilers.
after Monty's review.
- Item_param was rewritten.
- it turns out that we can't convert string data to character set of
connection on the fly, because they first should be written to the binary
log.
To support efficient conversion we need to rewrite prepared statements
binlogging code first.
include/my_global.h:
Macro swap(a, b, c) was renamed to resolve name conflict with
String::swap() method.
include/my_sys.h:
Added declaration of escape_string_for_mysql()
include/mysql_com.h:
Removed and moved back: a macro which is visible to libmysql user but
has sence only in prepared statement protocol implementation.
isam/_search.c:
swap -> swap_variables
isam/test2.c:
swap -> swap_variables
libmysql/libmysql.c:
- sub_escape_string moved to mysys/charset.c to be visible in sql/
- few cleanups
myisam/mi_test2.c:
swap -> swap_variables
mysys/charset.c:
sub_escape_string was moved from libmysql.c to be able to use it in sql/
code.
mysys/my_chsize.c:
rename: swap -> swap_variables
mysys/my_compress.c:
swap -> swap_variables
mysys/my_handler.c:
swap -> swap_variables
sql/field.cc:
Field::store_time refactored to use TIME_to_string function from time.cc
sql/item.cc:
New implementation of Item_param class:
added support for character sets conversion.
sql/item.h:
Item_param:
- 'state' member introduced instead of many boolean variables.
- put ltime, int_value and real_value into union to save space.
- remove unimplemented members
- set_value renamed to set_str
sql/item_timefunc.cc:
Refactored to use functions from time.cc
sql/lock.cc:
rename: swap -> swap_variables
sql/mysql_priv.h:
- added declarations for TIME_to_ulonglong_*, TIME_to_string functions
- const specifiers for make_date, make_time, make_datetime arguments
sql/opt_range.cc:
rename: swap -> swap_variables
sql/protocol.cc:
- added character set conversion support to binary protocol.
- Protocol::convert changed to point at shared buffer in THD.
This lets us use one convert buffer for binary and simple protocol.
The same buffer is used for client->server conversions in prepared
statements code.
- string conversion code refactored to Protocol::store_string_aux function.
- few more comments
sql/protocol.h:
- Protocol::convert now points at THD::convert_buffer: we want to share one
buffer between all protocol implementations.
sql/sql_class.cc:
- implementation of THD::convert_string using THD::convert_buffer
(conversion of strings allocated in the system heap).
sql/sql_class.h:
- THD::convert_buffer is shared between THD and network Protocols and
used for character set conversion of strings.
- new function to convert String object from one charset to another using
THD::convert_buffer
sql/sql_insert.cc:
A little fix in a comment.
sql/sql_parse.cc:
Shrink convert buffer in the end of each statement.
sql/sql_prepare.cc:
Many changes:
- static specifier for set_param_* family of functions.
- FIELD_TYPE -> MYSQL_TYPE
- added set_param_binary as handler for BLOB types.
- added character set support
- added support for param typecode in mysql_stmt_get_longdata
(mysql_stmt_send_long_data handler)
- changes in Item_param deployed
- few cleanups
sql/sql_select.cc:
rename: swap -> swap_variables
sql/sql_string.cc:
- String::append rewritten to support character set conversion for
single-byte encodings.
- added String::swap method to efficiently exchange two string objects.
sql/sql_string.h:
Declraration for String::swap().
sql/time.cc:
- function TIME_to_string to convert TIME to String in default MySQL format
- family of functions TIME_to_ulonglong_*
tests/client_test.c:
Test for support for character set conversions in prepared statements
(binary and text data).
Ensure that mysqldump doesn't give an error about missing Index.xml when it's not needed
client/mysqldump.c:
Added better default --debug option
mysql-test/r/show_check.result:
Fixed result after Type->Engine conversion
mysys/charset.c:
Don't give error if Index.xml doesn't exists
(If we can't find the character set, the later error will include the used patch to the Index.xml file)
Don't read character set files if we are using only the default charset. In most cases the user will not anymore get a warning about missing character set files
Compare strings with space extend instead of space strip. Now the following comparisons holds: "a" == "a " and "a\t" < "a". (Bug #3152).
Note: Because of the above fix, one has to do a REPAIR on any table that has an ascii character < 32 last in a CHAR/VARCHAR/TEXT columns.
heap/hp_hash.c:
Comments and DBUG information
include/my_handler.h:
Updated prototype for mi_compare_text
myisam/ft_boolean_search.c:
Updated calls to mi_compare_text
myisam/ft_nlq_search.c:
Updated calls to mi_compare_text
myisam/ft_parser.c:
Updated calls to mi_compare_text
myisam/ft_stopwords.c:
Updated calls to mi_compare_text
myisam/ft_update.c:
Updated calls to mi_compare_text
myisam/mi_check.c:
Updated calls to mi_compare_text
myisam/mi_search.c:
Changed all string comparisons that removed end space to instead extend the shorter string with space
myisam/mi_unique.c:
Updated calls to mi_compare_text
myisam/mi_write.c:
Updated calls to mi_compare_text
myisam/myisam_ftdump.c:
Removed compiler warning
mysql-test/r/ctype_collate.result:
Fixed wrong result
mysql-test/r/heap_btree.result:
More tests
mysql-test/t/heap_btree.test:
more tests
mysys/charset.c:
Don't read charsets if we are only using default charset
Don't require 'init_available_charsets' to succeed.
mysys/my_handler.c:
Compare strings with space extend instead of space strip
mysys/tree.c:
Fixed code to get better results for range optimzier
sql/field.cc:
Compare strings with space extend instead of space strip
sql/filesort.cc:
Compare strings with space extend instead of space strip
sql/ha_heap.cc:
Created bit map for keys that are using BTREE. This allows the optimzer to use BTREE's for sorting
sql/ha_heap.h:
Created bit map for keys that are using BTREE. This allows the optimzer to use BTREE's for sorting
strings/ctype-big5.c:
Compare strings with space extend instead of space strip
strings/ctype-czech.c:
Indentation cleanup. Should be fixed to use space extend
strings/ctype-gbk.c:
Compare strings with space extend instead of space strip
strings/ctype-latin1.c:
Compare strings with space extend instead of space strip
Added missing my_hash_sort_latin1_de function
strings/ctype-mb.c:
For binary strings, don't remove end space when comparing
strings/ctype-simple.c:
Compare strings with space extend instead of space strip
strings/ctype-sjis.c:
Compare strings with space extend instead of space strip
strings/ctype-tis620.c:
Added comments that we should fix end space handling
strings/ctype-ucs2.c:
indentation fixes
strings/ctype-utf8.c:
Added comments that we should fix end space handling
strings/ctype-win1250ch.c:
Added comments that we should fix end space handling
Added 'select_to_file' class to be able to merge identical code for select_export and select_dump
client/mysql.cc:
Print mysql_insert_id() in 'status'
mysys/charset.c:
after merge fixup
sql/item_func.cc:
Code cleanup + new comments
sql/opt_range.cc:
Added SQL_SELECT::cleanup() to make it easier to reuse SQL_SELECT item's for sub selects.
sql/opt_range.h:
Added SQL_SELECT::cleanup() to make it easier to reuse SQL_SELECT item's for sub selects.
sql/sql_class.cc:
Added 'select_to_file' class to be able to merge identical code for select_export and select_dump
sql/sql_class.h:
Added 'select_to_file' class to be able to merge identical code for select_export and select_dump
sql/sql_select.cc:
Fixed bug when calling 'delete select' in sub selects. (Bug 2479)
(Test case is already commited to global source repository)
Fixed bug in optimizer where it didn't choose right table order in some cases
myisam/mi_delete.c:
Remove not needed include errno.h
myisam/mi_delete_table.c:
Remove not needed include errno.h
myisam/mi_extra.c:
Remove not needed include errno.h
myisam/mi_locking.c:
Remove not needed include errno.h
myisam/mi_log.c:
Remove not needed include errno.h
myisam/mi_page.c:
Remove not needed include errno.h
myisam/mi_rename.c:
Remove not needed include errno.h
myisam/mi_update.c:
Remove not needed include errno.h
myisam/mi_write.c:
Remove not needed include errno.h
mysql-test/r/subselect.result:
Update of test after optimzier fix
mysys/charset.c:
Code cleanup
sql/item_cmpfunc.cc:
Removed not needed comment
Indentation cleanup
sql/item_cmpfunc.h:
Indentation cleanup
sql/mysqld.cc:
Updated comment for expire_logs_days
sql/set_var.cc:
Remved duplicate code
sql/sql_select.cc:
Fixed bug in optimizer where it didn't choose right table order in some cases (Bug found and fixed by Igor)
he mysqld server crashes if issued a command select convert(...)
with a
non-compiled character set:
mysys/charset.c:
he mysqld server crashes if issued a command select convert(...)
with a
non-compiled character set:
Cleaned up embedded library access and query cache handling
Changed min stack size to 128K (to allow longer MyISAM keys)
Fixed wrong priority for XOR (should be less than NEG to get -1^1 to work)
client/mysqldump.c:
Fixed bugs found after merge
include/mysql_embed.h:
Disable query cache when using embedded version
myisam/mi_check.c:
Removed not used variable
mysql-test/r/auto_increment.result:
Fixed bugs found after merge
mysql-test/r/bdb.result:
Fixed bugs found after merge
mysql-test/r/func_group.result:
Fixed bugs found after merge
mysql-test/r/func_str.result:
Fixed bugs found after merge
mysql-test/r/func_time.result:
Fixed bugs found after merge
mysql-test/r/group_by.result:
Fixed bugs found after merge
mysql-test/r/innodb.result:
Fixed bugs found after merge
mysql-test/r/insert.result:
Fixed bugs found after merge
mysql-test/r/join_outer.result:
Fixed bugs found after merge
mysql-test/r/loaddata.result:
Fixed bugs found after merge
mysql-test/r/multi_update.result:
Fixed bugs found after merge
mysql-test/r/mysqldump.result:
Update results
mysql-test/r/rpl_EE_error.result:
Fixed bugs found after merge
mysql-test/r/rpl_multi_update.result:
Fixed bugs found after merge
mysql-test/r/symlink.result:
Update results
mysql-test/r/type_blob.result:
Update results
mysql-test/r/type_datetime.result:
Update results
mysql-test/r/type_decimal.result:
Update results
mysql-test/r/type_enum.result:
Fixed bugs found after merge
mysql-test/r/type_timestamp.result:
Update results
mysql-test/r/union.result:
Update results
mysql-test/r/warnings.result:
Update results
mysql-test/t/bdb.test:
Fix test for 4.1
mysql-test/t/innodb.test:
Fix test for 4.1
mysql-test/t/multi_update.test:
Fix test for 4.1
mysql-test/t/mysqldump.test:
Fix test for 4.1
mysql-test/t/rpl_EE_error.test:
Fix test for 4.1
mysql-test/t/rpl_multi_update.test:
Fix test for 4.1
mysql-test/t/union.test:
Cleanup
mysys/charset.c:
Check results from my_once_alloc()
mysys/my_handler.c:
part of 4.0 merge
sql-common/client.c:
Part of 4.0 merge
sql/field.cc:
After merge fixes
sql/field.h:
After merge fixes
sql/ha_innodb.cc:
Remove duplicate include files
sql/item.cc:
Changed automatic int conversion to be of type binary
sql/item.h:
After merge fixes
sql/item_func.cc:
Changed automatic int conversion to be of type binary
sql/item_func.h:
After merge fixes
sql/item_strfunc.cc:
Added comments
sql/item_subselect.cc:
Indentation fixes
sql/item_sum.cc:
Changed automatic int conversion to be of type binary
sql/item_sum.h:
After merge fixes
sql/mysql_priv.h:
Cleanup embedded library access checks
sql/mysqld.cc:
Changed min stack size to 128K (to allow longer MyISAM keys)
sql/set_var.cc:
Fixed compiler warnings
sql/share/czech/errmsg.txt:
Better error message
sql/share/danish/errmsg.txt:
Better error message
sql/share/dutch/errmsg.txt:
Better error message
sql/share/english/errmsg.txt:
Better error message
sql/share/estonian/errmsg.txt:
Better error message
sql/share/french/errmsg.txt:
Better error message
sql/share/greek/errmsg.txt:
Better error message
sql/share/hungarian/errmsg.txt:
Better error message
sql/share/italian/errmsg.txt:
Better error message
sql/share/japanese/errmsg.txt:
Better error message
sql/share/korean/errmsg.txt:
Better error message
sql/share/norwegian-ny/errmsg.txt:
Better error message
sql/share/norwegian/errmsg.txt:
Better error message
sql/share/polish/errmsg.txt:
Better error message
sql/share/romanian/errmsg.txt:
Better error message
sql/share/russian/errmsg.txt:
Better error message
sql/share/serbian/errmsg.txt:
Better error message
sql/share/slovak/errmsg.txt:
Better error message
sql/share/spanish/errmsg.txt:
Better error message
sql/share/swedish/errmsg.txt:
Better error message
sql/share/ukrainian/errmsg.txt:
Better error message
sql/sql_acl.h:
Cleaned up embedded library acccess checks
sql/sql_base.cc:
After merge fixes
sql/sql_client.cc:
After merge fixes
sql/sql_parse.cc:
After merge fixes
Changed access check code for embedded library (needed to make code shorter and ensure that check_table_access() is called)
Recoded create-table handling for CREATE TABLE ... SELECT to make code shorter and faster
sql/sql_prepare.cc:
Add missing arguments
sql/sql_select.cc:
After merge fixes
sql/sql_update.cc:
After merge fixes
sql/sql_yacc.yy:
Fixed wrong priority for XOR (should be less than NEG to get -1^1 to work)
sql/table.cc:
After merge fixes
(isn't it obvious ?)
mysys/charset.c:
all charsets support my_mbcharlen - no need to protect it with use_mb()
sql/sql_load.cc:
all charsets support my_mbcharlen - no need to protect it with use_mb()
Remove dependency of charsets (in my_init) to get smaller binaries when charsets are not used
Simple code cleanup
client/mysql.cc:
Fixed indentation
include/my_sys.h:
Move init_compiled_charsets to own file
include/mysql.h:
Remove compiler warning
libmysql/Makefile.shared:
Move init_compiled_charsets to own file
mysys/Makefile.am:
Move init_compiled_charsets to own file
mysys/charset.c:
Move init_compiled_charsets to own file
mysys/my_init.c:
Remove dependency of charsets
scripts/mysql_create_system_tables.sh:
Remove run time warning
scripts/mysql_fix_privilege_tables.sql:
Add help tables
sql/sql_insert.cc:
Code cleanup
comp_err failed to compile error message file when a
character set was not incompiled.
mysys/charset.c:
comp_err failed to compile error message file when a
character set was not incompiled.
sequence boundaries in functions LIKE and LOCATE in
the case of "binary" collation. Comparison was done
like if the strings were just a binary strings without
character set assumption.
Fixed wrong value for SQLSTATE_LENGTH
Added CLIENT_REMEMBER_OPTIONS to mysql_real_connect()
Changed mysql_port and mysql_unix_port to mysqld_xxxx
client/mysql.cc:
Removed valgrind & compiler warnings
client/sql_string.h:
Fix to remove valgrind warnings
include/mysql.h:
Added read_timeout and write_timeout to mysql options struct.
This is to be used for slave when connection to master.
code cleanup
include/mysql_com.h:
Fixed wrong value for SQLSTATE_LENGTH
Added CLIENT_REMEMBER_OPTIONS
include/sql_common.h:
Cleanup after split of libmysql.c to client.c and libmysql.c
include/sql_state.h:
Removed default states
libmysql/client_settings.h:
Cleanup after split of libmysql.c to client.c and libmysql.c
libmysql/libmysql.c:
Cleanup after split of libmysql.c to client.c and libmysql.c
mysql-test/r/type_blob.result:
Update results after someone updated error messages without running tests
mysys/charset.c:
More debug information
mysys/errors.c:
Fixed wrong error message
sql-common/client.c:
Cleanup after split of libmysql.c to client.c and libmysql.c
sql/Makefile.am:
Added sql_client.cc
sql/client_settings.h:
Cleanup after split of libmysql.c to client.c and libmysql.c
sql/log.cc:
Changed mysql_port and mysql_unix_port to mysqld_xxxx
sql/mysql_priv.h:
Changed mysql_port and mysql_unix_port to mysqld_xxxx
sql/mysqld.cc:
Changed mysql_port and mysql_unix_port to mysqld_xxxx
sql/protocol.cc:
Fix for SQLSTATE_LENGTH
Moved function to sql_client.c
sql/repl_failsafe.cc:
Cleanup after split of libmysql.c to client.c and libmysql.c
sql/set_var.cc:
Changed mysql_port and mysql_unix_port to mysqld_xxxx
sql/slave.cc:
Cleanup after split of libmysql.c to client.c and libmysql.c
Bug fix: if latin2_czech_ci is not compiled, loader din't load other latin2 collations
mysys/charset.c:
Bug fix: if latin2_czech_ci is not compiled, loader din't load other latin2 collations
collation_client -> character_set_client
collation_results -> character_set_results
character_set -> character_set_server
SET NAMES now doesn't start client->server conversion
SET CHARACTER SET now starts both client->server and server->client conversion