Commit af4bafa4 authored by unknown's avatar unknown

Merge sinisa@work.mysql.com:/home/bk/mysql-4.1

into sinisa.nasamreza.org:/mnt/work/mysql-4.1

parents eb377d06 0a11536c
...@@ -937,7 +937,7 @@ static TYPELIB option_types={array_elements(default_options)-1, ...@@ -937,7 +937,7 @@ static TYPELIB option_types={array_elements(default_options)-1,
static int add_init_command(struct st_mysql_options *options, const char *cmd) static int add_init_command(struct st_mysql_options *options, const char *cmd)
{ {
char **ptr, *tmp; char *tmp;
if (!options->init_commands) if (!options->init_commands)
{ {
...@@ -947,7 +947,7 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd) ...@@ -947,7 +947,7 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd)
} }
if (!(tmp= my_strdup(cmd,MYF(MY_WME))) || if (!(tmp= my_strdup(cmd,MYF(MY_WME))) ||
insert_dynamic(options->init_commands, &tmp)) insert_dynamic(options->init_commands, (byte*)&tmp))
{ {
my_free(tmp, MYF(MY_ALLOW_ZERO_PTR)); my_free(tmp, MYF(MY_ALLOW_ZERO_PTR));
return 1; return 1;
......
...@@ -453,7 +453,7 @@ static TYPELIB option_types={array_elements(default_options)-1, ...@@ -453,7 +453,7 @@ static TYPELIB option_types={array_elements(default_options)-1,
static int add_init_command(struct st_mysql_options *options, const char *cmd) static int add_init_command(struct st_mysql_options *options, const char *cmd)
{ {
char **ptr, *tmp; char *tmp;
if (!options->init_commands) if (!options->init_commands)
{ {
...@@ -463,7 +463,7 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd) ...@@ -463,7 +463,7 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd)
} }
if (!(tmp= my_strdup(cmd,MYF(MY_WME))) || if (!(tmp= my_strdup(cmd,MYF(MY_WME))) ||
insert_dynamic(options->init_commands, &tmp)) insert_dynamic(options->init_commands, (byte*)&tmp))
{ {
my_free(tmp, MYF(MY_ALLOW_ZERO_PTR)); my_free(tmp, MYF(MY_ALLOW_ZERO_PTR));
return 1; return 1;
......
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
comment CHAR(32) CHARACTER SET latin1 NOT NULL, comment CHAR(32) ASCII NOT NULL,
koi8_ru_f CHAR(32) CHARACTER SET koi8_ru NOT NULL koi8_ru_f CHAR(32) CHARACTER SET koi8_ru NOT NULL
) CHARSET=latin5; ) CHARSET=latin5;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
...@@ -1291,7 +1291,8 @@ CYR CAPIT YA CYR CAPIT YA ...@@ -1291,7 +1291,8 @@ CYR CAPIT YA CYR CAPIT YA
CYR CAPIT YA CYR SMALL YA CYR CAPIT YA CYR SMALL YA
CYR SMALL YA CYR CAPIT YA CYR SMALL YA CYR CAPIT YA
CYR SMALL YA CYR SMALL 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 (0x0391,'GREEK CAPIT ALPHA');
INSERT INTO t1 (ucs2_f,comment) VALUES (0x0392,'GREEK CAPIT BETA'); INSERT INTO t1 (ucs2_f,comment) VALUES (0x0392,'GREEK CAPIT BETA');
INSERT INTO t1 (ucs2_f,comment) VALUES (0x0393,'GREEK CAPIT GAMMA'); INSERT INTO t1 (ucs2_f,comment) VALUES (0x0393,'GREEK CAPIT GAMMA');
......
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
comment CHAR(32) CHARACTER SET latin1 NOT NULL, comment CHAR(32) ASCII NOT NULL,
koi8_ru_f CHAR(32) CHARACTER SET koi8_ru NOT NULL koi8_ru_f CHAR(32) CHARACTER SET koi8_ru NOT NULL
) CHARSET=latin5; ) CHARSET=latin5;
...@@ -156,7 +156,8 @@ FROM t1 t11,t1 t12 ...@@ -156,7 +156,8 @@ FROM t1 t11,t1 t12
WHERE t11.koi8_ru_f=CONVERT(t12.utf8_f USING koi8_ru) WHERE t11.koi8_ru_f=CONVERT(t12.utf8_f USING koi8_ru)
ORDER BY t12.utf8_f,t11.comment,t12.comment; 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 (0x0391,'GREEK CAPIT ALPHA');
INSERT INTO t1 (ucs2_f,comment) VALUES (0x0392,'GREEK CAPIT BETA'); INSERT INTO t1 (ucs2_f,comment) VALUES (0x0392,'GREEK CAPIT BETA');
......
...@@ -59,6 +59,7 @@ static SYMBOL symbols[] = { ...@@ -59,6 +59,7 @@ static SYMBOL symbols[] = {
{ "ANY", SYM(ANY_SYM),0,0}, { "ANY", SYM(ANY_SYM),0,0},
{ "AS", SYM(AS),0,0}, { "AS", SYM(AS),0,0},
{ "ASC", SYM(ASC),0,0}, { "ASC", SYM(ASC),0,0},
{ "ASCII", SYM(ASCII_SYM),0,0},
{ "AVG", SYM(AVG_SYM),0,0}, { "AVG", SYM(AVG_SYM),0,0},
{ "AVG_ROW_LENGTH", SYM(AVG_ROW_LENGTH),0,0}, { "AVG_ROW_LENGTH", SYM(AVG_ROW_LENGTH),0,0},
{ "AUTO_INCREMENT", SYM(AUTO_INC),0,0}, { "AUTO_INCREMENT", SYM(AUTO_INC),0,0},
...@@ -374,6 +375,7 @@ static SYMBOL symbols[] = { ...@@ -374,6 +375,7 @@ static SYMBOL symbols[] = {
{ "TYPE", SYM(TYPE_SYM),0,0}, { "TYPE", SYM(TYPE_SYM),0,0},
{ "TYPES", SYM(TYPES_SYM),0,0}, { "TYPES", SYM(TYPES_SYM),0,0},
{ "UNCOMMITTED", SYM(UNCOMMITTED_SYM),0,0}, { "UNCOMMITTED", SYM(UNCOMMITTED_SYM),0,0},
{ "UNICODE", SYM(UNICODE_SYM),0,0},
{ "UNION", SYM(UNION_SYM),0,0}, { "UNION", SYM(UNION_SYM),0,0},
{ "UNIQUE", SYM(UNIQUE_SYM),0,0}, { "UNIQUE", SYM(UNIQUE_SYM),0,0},
{ "UNLOCK", SYM(UNLOCK_SYM),0,0}, { "UNLOCK", SYM(UNLOCK_SYM),0,0},
...@@ -412,7 +414,6 @@ static SYMBOL sql_functions[] = { ...@@ -412,7 +414,6 @@ static SYMBOL sql_functions[] = {
{ "AES_ENCRYPT", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_aes_encrypt)}, { "AES_ENCRYPT", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_aes_encrypt)},
{ "AES_DECRYPT", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_aes_decrypt)}, { "AES_DECRYPT", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_aes_decrypt)},
{ "AREA", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_area)}, { "AREA", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_area)},
{ "ASCII", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ascii)},
{ "ASIN", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_asin)}, { "ASIN", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_asin)},
{ "ASTEXT", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_as_text)}, { "ASTEXT", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_as_text)},
{ "ATAN", SYM(ATAN),0,0}, { "ATAN", SYM(ATAN),0,0},
......
...@@ -361,6 +361,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); ...@@ -361,6 +361,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token UDF_SYM %token UDF_SYM
%token UNCOMMITTED_SYM %token UNCOMMITTED_SYM
%token UNDERSCORE_CHARSET %token UNDERSCORE_CHARSET
%token UNICODE_SYM
%token UNION_SYM %token UNION_SYM
%token UNIQUE_SYM %token UNIQUE_SYM
%token USAGE %token USAGE
...@@ -380,6 +381,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); ...@@ -380,6 +381,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token ERRORS %token ERRORS
%token WARNINGS %token WARNINGS
%token ASCII_SYM
%token BIGINT %token BIGINT
%token BLOB_SYM %token BLOB_SYM
%token CHAR_SYM %token CHAR_SYM
...@@ -1257,11 +1259,19 @@ opt_db_default_character_set: ...@@ -1257,11 +1259,19 @@ opt_db_default_character_set:
opt_binary: opt_binary:
/* empty */ { Lex->charset=NULL; } /* empty */ { Lex->charset=NULL; }
| ASCII_SYM { Lex->charset=my_charset_latin1; }
| BYTE_SYM { Lex->charset=my_charset_bin; } | BYTE_SYM { Lex->charset=my_charset_bin; }
| BINARY { 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; } ; | CHAR_SYM SET charset_name { Lex->charset=$3; } ;
opt_primary: opt_primary:
/* empty */ /* empty */
| PRIMARY_SYM | PRIMARY_SYM
...@@ -2014,6 +2024,7 @@ simple_expr: ...@@ -2014,6 +2024,7 @@ simple_expr:
| MATCH ident_list_arg AGAINST '(' expr IN_SYM BOOLEAN_SYM MODE_SYM ')' | MATCH ident_list_arg AGAINST '(' expr IN_SYM BOOLEAN_SYM MODE_SYM ')'
{ Select->add_ftfunc_to_list((Item_func_match *) { Select->add_ftfunc_to_list((Item_func_match *)
($$=new Item_func_match_bool(*$2,$5))); } ($$=new Item_func_match_bool(*$2,$5))); }
| ASCII_SYM '(' expr ')' { $$= new Item_func_ascii($3); }
| BINARY expr %prec NEG { $$= new Item_func_set_collation($2,my_charset_bin); } | BINARY expr %prec NEG { $$= new Item_func_set_collation($2,my_charset_bin); }
| CAST_SYM '(' expr AS cast_type ')' { $$= create_func_cast($3, $5); } | CAST_SYM '(' expr AS cast_type ')' { $$= create_func_cast($3, $5); }
| CASE_SYM opt_expr WHEN_SYM when_list opt_else END | CASE_SYM opt_expr WHEN_SYM when_list opt_else END
...@@ -3721,6 +3732,7 @@ keyword: ...@@ -3721,6 +3732,7 @@ keyword:
| AGAINST {} | AGAINST {}
| AGGREGATE_SYM {} | AGGREGATE_SYM {}
| ANY_SYM {} | ANY_SYM {}
| ASCII_SYM {}
| AUTO_INC {} | AUTO_INC {}
| AVG_ROW_LENGTH {} | AVG_ROW_LENGTH {}
| AVG_SYM {} | AVG_SYM {}
...@@ -3872,6 +3884,7 @@ keyword: ...@@ -3872,6 +3884,7 @@ keyword:
| TYPE_SYM {} | TYPE_SYM {}
| UDF_SYM {} | UDF_SYM {}
| UNCOMMITTED_SYM {} | UNCOMMITTED_SYM {}
| UNICODE_SYM {}
| USE_FRM {} | USE_FRM {}
| VARIABLES {} | VARIABLES {}
| VALUE_SYM {} | 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