summaryrefslogtreecommitdiff
path: root/isam/_search.c
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2004-05-25 02:03:49 +0400
committerunknown <konstantin@mysql.com>2004-05-25 02:03:49 +0400
commit093d62922b326cec1a05bd8baba2d9ed96137488 (patch)
tree39de3845fc8340f9a27f30803b9104e416c7ab62 /isam/_search.c
parent88da3ae5f9e69a3bf6ced379908d01da5b3bfbb0 (diff)
downloadmariadb-git-093d62922b326cec1a05bd8baba2d9ed96137488.tar.gz
Support for character set conversion in binary protocol: another go
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).
Diffstat (limited to 'isam/_search.c')
-rw-r--r--isam/_search.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/isam/_search.c b/isam/_search.c
index 7b61abfb46b..fbffd6786e1 100644
--- a/isam/_search.c
+++ b/isam/_search.c
@@ -489,7 +489,7 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar
int alength,blength;
if (swap_flag)
- swap(uchar*,a,b);
+ swap_variables(uchar*, a, b);
alength= *a++; blength= *b++;
if ((flag=(int) (keyseg->base.length-key_length)) < 0)
flag=0;
@@ -504,7 +504,7 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar
if (*a == '-' && *b == '-')
{
swap_flag=1;
- swap(uchar*,a,b);
+ swap_variables(uchar*, a, b);
}
end=a+alength;
while (a < end)
@@ -531,7 +531,7 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar
if (swap_flag)
{
end=b+(int) (end-a);
- swap(uchar*,a,b);
+ swap_variables(uchar*, a, b);
}
while (a < end)
if (*a++ != *b++)
@@ -550,7 +550,7 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar
}
}
if (swap_flag)
- swap(uchar*,a,b);
+ swap_variables(uchar*, a, b);
break;
}
#ifdef HAVE_LONG_LONG