summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2005-04-21 15:09:10 +0300
committerunknown <marko@hundin.mysql.fi>2005-04-21 15:09:10 +0300
commit13e4188f33321400c544f1844d84063bc99957d3 (patch)
treea7cc397e8ca71d1edb546d2526ea139d72c09fbc
parent353e499c0d5720fdcb801cd93096dbb898247988 (diff)
downloadmariadb-git-13e4188f33321400c544f1844d84063bc99957d3.tar.gz
InnoDB: Speed up comparison functions by making
DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL a constant. innobase/data/data0type.c: Remove data_mysql_latin1_swedish_charset_coll. innobase/include/data0type.h: Replace variable data_mysql_latin1_swedish_charset_coll with constant DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL. innobase/rem/rem0cmp.c: Replace variable data_mysql_latin1_swedish_charset_coll with constant DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL. sql/ha_innodb.cc: Eliminate variable data_mysql_latin1_swedish_charset_coll. Add an assertion about DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL.
-rw-r--r--innobase/data/data0type.c1
-rw-r--r--innobase/include/data0type.h2
-rw-r--r--innobase/rem/rem0cmp.c6
-rw-r--r--sql/ha_innodb.cc4
4 files changed, 6 insertions, 7 deletions
diff --git a/innobase/data/data0type.c b/innobase/data/data0type.c
index 3fcd666b5a5..36b0f9603e5 100644
--- a/innobase/data/data0type.c
+++ b/innobase/data/data0type.c
@@ -39,7 +39,6 @@ column definitions, or records in the insert buffer, we use this
charset-collation code for them. */
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 = &dtype_binary_val;
diff --git a/innobase/include/data0type.h b/innobase/include/data0type.h
index a4d2c1a2e1d..7e9692eca5a 100644
--- a/innobase/include/data0type.h
+++ b/innobase/include/data0type.h
@@ -12,7 +12,7 @@ Created 1/16/1996 Heikki Tuuri
#include "univ.i"
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 */
typedef struct dtype_struct dtype_t;
diff --git a/innobase/rem/rem0cmp.c b/innobase/rem/rem0cmp.c
index 74348b865a8..f8aed202586 100644
--- a/innobase/rem/rem0cmp.c
+++ b/innobase/rem/rem0cmp.c
@@ -320,7 +320,7 @@ cmp_data_data_slow(
|| (cur_type->mtype == DATA_BLOB
&& 0 == (cur_type->prtype & DATA_BINARY_TYPE)
&& 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,
data1, (unsigned) len1,
@@ -530,7 +530,7 @@ cmp_dtuple_rec_with_match(
|| (cur_type->mtype == DATA_BLOB
&& 0 == (cur_type->prtype & DATA_BINARY_TYPE)
&& 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,
@@ -832,7 +832,7 @@ cmp_rec_rec_with_match(
|| (cur_type->mtype == DATA_BLOB
&& 0 == (cur_type->prtype & DATA_BINARY_TYPE)
&& 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,
rec1_b_ptr, (unsigned) rec1_f_len,
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 53061c6f3a6..2a4c9159618 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -1271,8 +1271,8 @@ innobase_init(void)
data_mysql_default_charset_coll = (ulint)default_charset_info->number;
- data_mysql_latin1_swedish_charset_coll =
- (ulint)my_charset_latin1.number;
+ ut_a(DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL ==
+ my_charset_latin1.number);
/* Store the latin1_swedish_ci character ordering table to InnoDB. For
non-latin1_swedish_ci charsets we use the MySQL comparison functions,