mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
Introducing SAPDB-style
"fieldname CHAR(n) UNICODE" as a synonym to "fieldname CHAR(n) CHARACTER SET ucs2"
This commit is contained in:
parent
2cae041aa8
commit
bc7f8302a4
4 changed files with 15 additions and 2 deletions
|
@ -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 {}
|
||||
|
|
Loading…
Reference in a new issue