summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorunknown <gluh@mysql.com>2006-07-03 13:19:18 +0500
committerunknown <gluh@mysql.com>2006-07-03 13:19:18 +0500
commit3e085bd882a7283d43423c82d412ce276ff4ddcb (patch)
tree92f15fb2e6a466fe825bb95eacd1187eeef200bb /sql/sql_yacc.yy
parent4c2db1bef100a1159f65d3fad0ec764727198e58 (diff)
parent8703b22e167c706d5a8c77a1e24948b4db3fafb3 (diff)
downloadmariadb-git-3e085bd882a7283d43423c82d412ce276ff4ddcb.tar.gz
Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/gluh/MySQL/Merge/5.0-kt sql/item.cc: Auto merged sql/item.h: Auto merged sql/sql_acl.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.cc: Auto merged tests/mysql_client_test.c: Auto merged
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy42
1 files changed, 10 insertions, 32 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 952a8eb44ea..426c996ab01 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -2529,7 +2529,7 @@ create_table_option:
| MIN_ROWS opt_equal ulonglong_num { Lex->create_info.min_rows= $3; Lex->create_info.used_fields|= HA_CREATE_USED_MIN_ROWS;}
| AVG_ROW_LENGTH opt_equal ulong_num { Lex->create_info.avg_row_length=$3; Lex->create_info.used_fields|= HA_CREATE_USED_AVG_ROW_LENGTH;}
| PASSWORD opt_equal TEXT_STRING_sys { Lex->create_info.password=$3.str; Lex->create_info.used_fields|= HA_CREATE_USED_PASSWORD; }
- | COMMENT_SYM opt_equal TEXT_STRING_sys { Lex->create_info.comment=$3.str; Lex->create_info.used_fields|= HA_CREATE_USED_COMMENT; }
+ | COMMENT_SYM opt_equal TEXT_STRING_sys { Lex->create_info.comment=$3; Lex->create_info.used_fields|= HA_CREATE_USED_COMMENT; }
| AUTO_INC opt_equal ulonglong_num { Lex->create_info.auto_increment_value=$3; Lex->create_info.used_fields|= HA_CREATE_USED_AUTO;}
| PACK_KEYS_SYM opt_equal ulong_num
{
@@ -6522,24 +6522,10 @@ show_param:
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_SHOW_GRANTS;
- THD *thd= lex->thd;
- Security_context *sctx= thd->security_ctx;
LEX_USER *curr_user;
- if (!(curr_user= (LEX_USER*) thd->alloc(sizeof(st_lex_user))))
+ if (!(curr_user= (LEX_USER*) lex->thd->alloc(sizeof(st_lex_user))))
YYABORT;
- curr_user->user.str= sctx->priv_user;
- curr_user->user.length= strlen(sctx->priv_user);
- if (*sctx->priv_host != 0)
- {
- curr_user->host.str= sctx->priv_host;
- curr_user->host.length= strlen(sctx->priv_host);
- }
- else
- {
- curr_user->host.str= (char *) "%";
- curr_user->host.length= 1;
- }
- curr_user->password=null_lex_str;
+ bzero(curr_user, sizeof(st_lex_user));
lex->grant_user= curr_user;
}
| GRANTS FOR_SYM user
@@ -7489,22 +7475,14 @@ user:
}
| CURRENT_USER optional_braces
{
- THD *thd= YYTHD;
- Security_context *sctx= thd->security_ctx;
- if (!($$=(LEX_USER*) thd->alloc(sizeof(st_lex_user))))
+ if (!($$=(LEX_USER*) YYTHD->alloc(sizeof(st_lex_user))))
YYABORT;
- $$->user.str= sctx->priv_user;
- $$->user.length= strlen(sctx->priv_user);
- if (*sctx->priv_host != 0)
- {
- $$->host.str= sctx->priv_host;
- $$->host.length= strlen(sctx->priv_host);
- }
- else
- {
- $$->host.str= (char *) "%";
- $$->host.length= 1;
- }
+ /*
+ empty LEX_USER means current_user and
+ will be handled in the get_current_user() function
+ later
+ */
+ bzero($$, sizeof(LEX_USER));
};
/* Keyword that we allow for identifiers (except SP labels) */