Commit ab713b4b authored by marko@hundin.mysql.fi's avatar marko@hundin.mysql.fi

InnoDB: Speed up comparison functions by making

DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL a constant.
parent ffeee9ce
...@@ -39,7 +39,6 @@ column definitions, or records in the insert buffer, we use this ...@@ -39,7 +39,6 @@ column definitions, or records in the insert buffer, we use this
charset-collation code for them. */ charset-collation code for them. */
ulint data_mysql_default_charset_coll = 99999999; ulint data_mysql_default_charset_coll = 99999999;
ulint data_mysql_latin1_swedish_charset_coll = 99999999;
dtype_t dtype_binary_val = {DATA_BINARY, 0, 0, 0, 0, 0}; dtype_t dtype_binary_val = {DATA_BINARY, 0, 0, 0, 0, 0};
dtype_t* dtype_binary = &dtype_binary_val; dtype_t* dtype_binary = &dtype_binary_val;
......
...@@ -12,7 +12,7 @@ Created 1/16/1996 Heikki Tuuri ...@@ -12,7 +12,7 @@ Created 1/16/1996 Heikki Tuuri
#include "univ.i" #include "univ.i"
extern ulint data_mysql_default_charset_coll; extern ulint data_mysql_default_charset_coll;
extern ulint data_mysql_latin1_swedish_charset_coll; #define DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL 8
/* SQL data type struct */ /* SQL data type struct */
typedef struct dtype_struct dtype_t; typedef struct dtype_struct dtype_t;
......
...@@ -320,7 +320,7 @@ cmp_data_data_slow( ...@@ -320,7 +320,7 @@ cmp_data_data_slow(
|| (cur_type->mtype == DATA_BLOB || (cur_type->mtype == DATA_BLOB
&& 0 == (cur_type->prtype & DATA_BINARY_TYPE) && 0 == (cur_type->prtype & DATA_BINARY_TYPE)
&& dtype_get_charset_coll(cur_type->prtype) != && dtype_get_charset_coll(cur_type->prtype) !=
data_mysql_latin1_swedish_charset_coll)) { DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL)) {
return(cmp_whole_field(cur_type, return(cmp_whole_field(cur_type,
data1, (unsigned) len1, data1, (unsigned) len1,
...@@ -530,7 +530,7 @@ cmp_dtuple_rec_with_match( ...@@ -530,7 +530,7 @@ cmp_dtuple_rec_with_match(
|| (cur_type->mtype == DATA_BLOB || (cur_type->mtype == DATA_BLOB
&& 0 == (cur_type->prtype & DATA_BINARY_TYPE) && 0 == (cur_type->prtype & DATA_BINARY_TYPE)
&& dtype_get_charset_coll(cur_type->prtype) != && dtype_get_charset_coll(cur_type->prtype) !=
data_mysql_latin1_swedish_charset_coll)) { DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL)) {
ret = cmp_whole_field( ret = cmp_whole_field(
cur_type, cur_type,
...@@ -832,7 +832,7 @@ cmp_rec_rec_with_match( ...@@ -832,7 +832,7 @@ cmp_rec_rec_with_match(
|| (cur_type->mtype == DATA_BLOB || (cur_type->mtype == DATA_BLOB
&& 0 == (cur_type->prtype & DATA_BINARY_TYPE) && 0 == (cur_type->prtype & DATA_BINARY_TYPE)
&& dtype_get_charset_coll(cur_type->prtype) != && dtype_get_charset_coll(cur_type->prtype) !=
data_mysql_latin1_swedish_charset_coll)) { DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL)) {
ret = cmp_whole_field(cur_type, ret = cmp_whole_field(cur_type,
rec1_b_ptr, (unsigned) rec1_f_len, rec1_b_ptr, (unsigned) rec1_f_len,
......
...@@ -1271,8 +1271,8 @@ innobase_init(void) ...@@ -1271,8 +1271,8 @@ innobase_init(void)
data_mysql_default_charset_coll = (ulint)default_charset_info->number; data_mysql_default_charset_coll = (ulint)default_charset_info->number;
data_mysql_latin1_swedish_charset_coll = ut_a(DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL ==
(ulint)my_charset_latin1.number; my_charset_latin1.number);
/* Store the latin1_swedish_ci character ordering table to InnoDB. For /* Store the latin1_swedish_ci character ordering table to InnoDB. For
non-latin1_swedish_ci charsets we use the MySQL comparison functions, non-latin1_swedish_ci charsets we use the MySQL comparison functions,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment