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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
09ed6940
Commit
09ed6940
authored
Dec 05, 2002
by
serg@serg.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
current_user() to return priv_user
parent
f7bec0d8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
3 deletions
+15
-3
sql/item.h
sql/item.h
+3
-1
sql/item_create.cc
sql/item_create.cc
+10
-1
sql/item_create.h
sql/item_create.h
+1
-0
sql/lex.h
sql/lex.h
+1
-1
No files found.
sql/item.h
View file @
09ed6940
...
...
@@ -267,6 +267,8 @@ class Item_string :public Item
}
Item_string
(
const
char
*
name_par
,
const
char
*
str
,
uint
length
)
{
if
(
!
length
)
length
=
strlen
(
str
);
str_value
.
set
(
str
,
length
);
max_length
=
length
;
name
=
(
char
*
)
name_par
;
...
...
sql/item_create.cc
View file @
09ed6940
...
...
@@ -291,6 +291,15 @@ Item *create_func_pow(Item* a, Item *b)
return
new
Item_func_pow
(
a
,
b
);
}
Item
*
create_func_current_user
()
{
THD
*
thd
=
current_thd
;
Item_string
*
res
=
new
Item_string
(
"CURRENT_USER()"
,
thd
->
priv_user
,
0
);
res
->
append
(
"@"
,
1
);
res
->
append
((
char
*
)
thd
->
host_or_ip
,
0
);
return
res
;
}
Item
*
create_func_quarter
(
Item
*
a
)
{
return
new
Item_func_quarter
(
a
);
...
...
@@ -394,7 +403,7 @@ Item *create_func_ucase(Item* a)
Item
*
create_func_version
(
void
)
{
return
new
Item_string
(
NullS
,
server_version
,
(
uint
)
strlen
(
server_version
)
);
return
new
Item_string
(
"VERSION()"
,
server_version
,
0
);
}
Item
*
create_func_weekday
(
Item
*
a
)
...
...
sql/item_create.h
View file @
09ed6940
...
...
@@ -68,6 +68,7 @@ Item *create_func_period_add(Item* a, Item *b);
Item
*
create_func_period_diff
(
Item
*
a
,
Item
*
b
);
Item
*
create_func_pi
(
void
);
Item
*
create_func_pow
(
Item
*
a
,
Item
*
b
);
Item
*
create_func_current_user
(
void
);
Item
*
create_func_quarter
(
Item
*
a
);
Item
*
create_func_radians
(
Item
*
a
);
Item
*
create_func_release_lock
(
Item
*
a
);
...
...
sql/lex.h
View file @
09ed6940
...
...
@@ -398,7 +398,7 @@ static SYMBOL sql_functions[] = {
{
"CAST"
,
SYM
(
CAST_SYM
),
0
,
0
},
{
"CEIL"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_ceiling
)},
{
"CEILING"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_ceiling
)},
{
"CURRENT_USER"
,
SYM
(
USER
),
0
,
0
},
{
"CURRENT_USER"
,
SYM
(
FUNC_ARG0
),
0
,
CREATE_FUNC
(
create_func_current_user
)
},
{
"BIT_LENGTH"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_bit_length
)},
{
"CHAR_LENGTH"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_char_length
)},
{
"CHARACTER_LENGTH"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_char_length
)},
...
...
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