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/item.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/item.h')
-rw-r--r-- | sql/item.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/item.h b/sql/item.h index 621dc017d25..3412b43da44 100644 --- a/sql/item.h +++ b/sql/item.h @@ -419,7 +419,7 @@ public: { collation.set(cs, dv); str_value.set(str,length,cs); - max_length=length; + max_length= str_value.numchars()*cs->mbmaxlen; set_name(str, length, cs); decimals=NOT_FIXED_DEC; } @@ -428,7 +428,7 @@ public: { collation.set(cs, dv); str_value.set(str,length,cs); - max_length=length; + max_length= str_value.numchars()*cs->mbmaxlen; set_name(name_par,0,cs); decimals=NOT_FIXED_DEC; } |