diff options
author | unknown <bar@bar.mysql.r18.ru> | 2003-08-11 18:18:34 +0500 |
---|---|---|
committer | unknown <bar@bar.mysql.r18.ru> | 2003-08-11 18:18:34 +0500 |
commit | 0960c3eb26861238d9102845d370f3eb66d91290 (patch) | |
tree | 3818f3663ab056711a4b873e3abb17725b1cb138 /sql/unireg.h | |
parent | f3f6e5e9b2ecfef9bf6c5e7558af2481e30385ad (diff) | |
download | mariadb-git-0960c3eb26861238d9102845d370f3eb66d91290.tar.gz |
Fix: create table t1 (a char(10) character set cp1251) SELECT _koi8r'blabla' as a
The above query created a field of koi8r charset, not cp1251
Change:
CREATE TABLE a (a CHAR(1) CHARACTER SET utf8)
Length now means character length, not byte length.
The above creates a field that guarantees can store a multibyte value
1 character long. For utf8 the above creates a field that can store
3 bytes.
Diffstat (limited to 'sql/unireg.h')
-rw-r--r-- | sql/unireg.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/unireg.h b/sql/unireg.h index 4bbfa8b0fae..4920d4b609a 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -58,7 +58,12 @@ #endif #define MAX_HOSTNAME 61 /* len+1 in mysql.user */ -#define MAX_FIELD_WIDTH 256 /* Max column width +1 */ +#define MAX_MBWIDTH 3 /* Max multibyte sequence */ +#define MAX_FIELD_CHARLENGTH 255 +/* Max column width +1 */ +#define MAX_FIELD_WIDTH (MAX_FIELD_CHARLENGTH*MAX_MBWIDTH+1) + + #define MAX_TABLES (sizeof(table_map)*8-2) /* Max tables in join */ #define OUTER_REF_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-2)) #define RAND_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-1)) |