Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
bc1fe848
Commit
bc1fe848
authored
Apr 05, 2003
by
mysql@home.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sql_yacc.yy, set_var.h, set_var.cc:
Optimization of SET NAMES
parent
6a948b83
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
14 deletions
+46
-14
sql/set_var.cc
sql/set_var.cc
+28
-0
sql/set_var.h
sql/set_var.h
+15
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+3
-14
No files found.
sql/set_var.cc
View file @
bc1fe848
...
@@ -1655,6 +1655,34 @@ int set_var_password::update(THD *thd)
...
@@ -1655,6 +1655,34 @@ int set_var_password::update(THD *thd)
1
:
0
);
1
:
0
);
}
}
/*****************************************************************************
Functions to handle SET NAMES and SET CHARACTER SET
*****************************************************************************/
int
set_var_client_collation
::
check
(
THD
*
thd
)
{
return
0
;
}
int
set_var_client_collation
::
update
(
THD
*
thd
)
{
#if 0
if (var->type == OPT_GLOBAL)
global_system_variables.thd_charset= var->save_result.charset;
else
#endif
{
thd
->
variables
.
thd_charset
=
client_collation
;
thd
->
variables
.
convert_result_charset
=
convert_result_charset
;
thd
->
protocol_simple
.
init
(
thd
);
thd
->
protocol_prep
.
init
(
thd
);
}
return
0
;
}
/****************************************************************************
/****************************************************************************
Used templates
Used templates
****************************************************************************/
****************************************************************************/
...
...
sql/set_var.h
View file @
bc1fe848
...
@@ -526,6 +526,21 @@ public:
...
@@ -526,6 +526,21 @@ public:
};
};
/* For SET NAMES and SET CHARACTER SET */
class
set_var_client_collation
:
public
set_var_base
{
CHARSET_INFO
*
client_collation
;
my_bool
convert_result_charset
;
public:
set_var_client_collation
(
CHARSET_INFO
*
coll_arg
,
my_bool
conv_arg
)
:
client_collation
(
coll_arg
),
convert_result_charset
(
conv_arg
)
{}
int
check
(
THD
*
thd
);
int
update
(
THD
*
thd
);
};
/*
/*
Prototypes for helper functions
Prototypes for helper functions
*/
*/
...
...
sql/sql_yacc.yy
View file @
bc1fe848
...
@@ -4409,19 +4409,13 @@ option_value:
...
@@ -4409,19 +4409,13 @@ option_value:
cl->name,cs->csname);
cl->name,cs->csname);
YYABORT;
YYABORT;
}
}
Item_string *csname= new Item_string(cl->name,
lex->var_list.push_back(new set_var_client_collation(cl,1));
strlen(cl->name),
&my_charset_latin1);
lex->var_list.push_back(new set_var(lex->option_type,
find_sys_var("client_collation"),
csname));
}
}
| COLLATION_SYM collation_name_or_default
| COLLATION_SYM collation_name_or_default
{
{
THD* thd= YYTHD;
THD* thd= YYTHD;
LEX *lex= &thd->lex;
LEX *lex= &thd->lex;
system_variables *vars= &thd->variables;
CHARSET_INFO *cs= thd->variables->vars->thd_charset;
CHARSET_INFO *cs= vars->thd_charset;
CHARSET_INFO *cl= $2;
CHARSET_INFO *cl= $2;
if (!cl)
if (!cl)
...
@@ -4438,12 +4432,7 @@ option_value:
...
@@ -4438,12 +4432,7 @@ option_value:
cl->name,cs->csname);
cl->name,cs->csname);
YYABORT;
YYABORT;
}
}
Item_string *csname= new Item_string(cl->name,
lex->var_list.push_back(new set_var_client_collation(cl,1));
strlen(cl->name),
&my_charset_latin1);
lex->var_list.push_back(new set_var(lex->option_type,
find_sys_var("client_collation"),
csname));
}
}
| PASSWORD equal text_or_password
| PASSWORD equal text_or_password
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment