summaryrefslogtreecommitdiff
path: root/sql/unireg.h
diff options
context:
space:
mode:
authorbar@bar.mysql.r18.ru <>2003-08-11 18:18:34 +0500
committerbar@bar.mysql.r18.ru <>2003-08-11 18:18:34 +0500
commit786af3414626ec0ddb89041ec7a3b1af14724031 (patch)
tree3818f3663ab056711a4b873e3abb17725b1cb138 /sql/unireg.h
parentda8ab7dd528ad95692a8674977ccf6a9edb7c5e4 (diff)
downloadmariadb-git-786af3414626ec0ddb89041ec7a3b1af14724031.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.h7
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))