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
fc076abe
Commit
fc076abe
authored
Dec 05, 2002
by
serg@serg.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge work:/home/bk/mysql-4.0
into serg.mysql.com:/usr/home/serg/Abk/mysql-4.0
parents
496a0e16
09ed6940
Changes
4
Hide 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 @
fc076abe
...
@@ -267,6 +267,8 @@ class Item_string :public Item
...
@@ -267,6 +267,8 @@ class Item_string :public Item
}
}
Item_string
(
const
char
*
name_par
,
const
char
*
str
,
uint
length
)
Item_string
(
const
char
*
name_par
,
const
char
*
str
,
uint
length
)
{
{
if
(
!
length
)
length
=
strlen
(
str
);
str_value
.
set
(
str
,
length
);
str_value
.
set
(
str
,
length
);
max_length
=
length
;
max_length
=
length
;
name
=
(
char
*
)
name_par
;
name
=
(
char
*
)
name_par
;
...
@@ -286,7 +288,7 @@ class Item_string :public Item
...
@@ -286,7 +288,7 @@ class Item_string :public Item
String
*
const_string
()
{
return
&
str_value
;
}
String
*
const_string
()
{
return
&
str_value
;
}
inline
void
append
(
char
*
str
,
uint
length
)
{
str_value
.
append
(
str
,
length
);
}
inline
void
append
(
char
*
str
,
uint
length
)
{
str_value
.
append
(
str
,
length
);
}
void
print
(
String
*
str
);
void
print
(
String
*
str
);
unsigned
int
size_of
()
{
return
sizeof
(
*
this
);}
unsigned
int
size_of
()
{
return
sizeof
(
*
this
);}
};
};
...
...
sql/item_create.cc
View file @
fc076abe
...
@@ -291,6 +291,15 @@ Item *create_func_pow(Item* a, Item *b)
...
@@ -291,6 +291,15 @@ Item *create_func_pow(Item* a, Item *b)
return
new
Item_func_pow
(
a
,
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
)
Item
*
create_func_quarter
(
Item
*
a
)
{
{
return
new
Item_func_quarter
(
a
);
return
new
Item_func_quarter
(
a
);
...
@@ -394,7 +403,7 @@ Item *create_func_ucase(Item* a)
...
@@ -394,7 +403,7 @@ Item *create_func_ucase(Item* a)
Item
*
create_func_version
(
void
)
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
)
Item
*
create_func_weekday
(
Item
*
a
)
...
...
sql/item_create.h
View file @
fc076abe
...
@@ -68,6 +68,7 @@ Item *create_func_period_add(Item* a, Item *b);
...
@@ -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_period_diff
(
Item
*
a
,
Item
*
b
);
Item
*
create_func_pi
(
void
);
Item
*
create_func_pi
(
void
);
Item
*
create_func_pow
(
Item
*
a
,
Item
*
b
);
Item
*
create_func_pow
(
Item
*
a
,
Item
*
b
);
Item
*
create_func_current_user
(
void
);
Item
*
create_func_quarter
(
Item
*
a
);
Item
*
create_func_quarter
(
Item
*
a
);
Item
*
create_func_radians
(
Item
*
a
);
Item
*
create_func_radians
(
Item
*
a
);
Item
*
create_func_release_lock
(
Item
*
a
);
Item
*
create_func_release_lock
(
Item
*
a
);
...
...
sql/lex.h
View file @
fc076abe
...
@@ -398,7 +398,7 @@ static SYMBOL sql_functions[] = {
...
@@ -398,7 +398,7 @@ static SYMBOL sql_functions[] = {
{
"CAST"
,
SYM
(
CAST_SYM
),
0
,
0
},
{
"CAST"
,
SYM
(
CAST_SYM
),
0
,
0
},
{
"CEIL"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_ceiling
)},
{
"CEIL"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_ceiling
)},
{
"CEILING"
,
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
)},
{
"BIT_LENGTH"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_bit_length
)},
{
"CHAR_LENGTH"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_char_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
)},
{
"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