Commit a39e7587 authored by unknown's avatar unknown

Introducing SAPDB-style

   "fieldname CHAR(n) UNICODE"
as a synonym to
   "fieldname CHAR(n) CHARACTER SET ucs2"
parent e824dfbe
......@@ -1291,7 +1291,8 @@ CYR CAPIT YA CYR CAPIT YA
CYR CAPIT YA CYR SMALL YA
CYR SMALL YA CYR CAPIT YA
CYR SMALL YA CYR SMALL YA
ALTER TABLE t1 ADD ucs2_f CHAR(32) CHARACTER SET ucs2 NOT NULL;
ALTER TABLE t1 ADD ucs2_f CHAR(32) CHARACTER SET ucs2;
ALTER TABLE t1 CHANGE ucs2_f ucs2_f CHAR(32) UNICODE NOT NULL;
INSERT INTO t1 (ucs2_f,comment) VALUES (0x0391,'GREEK CAPIT ALPHA');
INSERT INTO t1 (ucs2_f,comment) VALUES (0x0392,'GREEK CAPIT BETA');
INSERT INTO t1 (ucs2_f,comment) VALUES (0x0393,'GREEK CAPIT GAMMA');
......
......@@ -156,7 +156,8 @@ FROM t1 t11,t1 t12
WHERE t11.koi8_ru_f=CONVERT(t12.utf8_f USING koi8_ru)
ORDER BY t12.utf8_f,t11.comment,t12.comment;
ALTER TABLE t1 ADD ucs2_f CHAR(32) CHARACTER SET ucs2 NOT NULL;
ALTER TABLE t1 ADD ucs2_f CHAR(32) CHARACTER SET ucs2;
ALTER TABLE t1 CHANGE ucs2_f ucs2_f CHAR(32) UNICODE NOT NULL;
INSERT INTO t1 (ucs2_f,comment) VALUES (0x0391,'GREEK CAPIT ALPHA');
INSERT INTO t1 (ucs2_f,comment) VALUES (0x0392,'GREEK CAPIT BETA');
......
......@@ -374,6 +374,7 @@ static SYMBOL symbols[] = {
{ "TYPE", SYM(TYPE_SYM),0,0},
{ "TYPES", SYM(TYPES_SYM),0,0},
{ "UNCOMMITTED", SYM(UNCOMMITTED_SYM),0,0},
{ "UNICODE", SYM(UNICODE_SYM),0,0},
{ "UNION", SYM(UNION_SYM),0,0},
{ "UNIQUE", SYM(UNIQUE_SYM),0,0},
{ "UNLOCK", SYM(UNLOCK_SYM),0,0},
......
......@@ -361,6 +361,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token UDF_SYM
%token UNCOMMITTED_SYM
%token UNDERSCORE_CHARSET
%token UNICODE_SYM
%token UNION_SYM
%token UNIQUE_SYM
%token USAGE
......@@ -1259,6 +1260,14 @@ opt_binary:
/* empty */ { Lex->charset=NULL; }
| BYTE_SYM { Lex->charset=my_charset_bin; }
| BINARY { Lex->charset=my_charset_bin; }
| UNICODE_SYM
{
if (!(Lex->charset=get_charset_by_name("ucs2",MYF(0))))
{
net_printf(YYTHD,ER_UNKNOWN_CHARACTER_SET,"ucs2");
YYABORT;
}
}
| CHAR_SYM SET charset_name { Lex->charset=$3; } ;
......@@ -3872,6 +3881,7 @@ keyword:
| TYPE_SYM {}
| UDF_SYM {}
| UNCOMMITTED_SYM {}
| UNICODE_SYM {}
| USE_FRM {}
| VARIABLES {}
| VALUE_SYM {}
......
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