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
d7e308c6
Commit
d7e308c6
authored
Oct 01, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
turn Item_func_set_user_var
::native_val, ::native_val_int and native_val_str into inline
parent
de6a1085
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
36 deletions
+31
-36
sql/item_func.cc
sql/item_func.cc
+0
-32
sql/item_func.h
sql/item_func.h
+31
-4
No files found.
sql/item_func.cc
View file @
d7e308c6
...
@@ -1899,38 +1899,6 @@ void Item_func_set_user_var::update_hash(void *ptr, uint length,
...
@@ -1899,38 +1899,6 @@ void Item_func_set_user_var::update_hash(void *ptr, uint length,
return
;
return
;
}
}
double
Item_func_set_user_var
::
native_val
()
{
double
value
=
args
[
0
]
->
val
();
update_hash
((
void
*
)
&
value
,
sizeof
(
value
),
REAL_RESULT
);
return
value
;
}
longlong
Item_func_set_user_var
::
native_val_int
()
{
longlong
value
=
args
[
0
]
->
val_int
();
update_hash
((
void
*
)
&
value
,
sizeof
(
longlong
),
INT_RESULT
);
return
value
;
}
String
*
Item_func_set_user_var
::
native_val_str
(
String
*
str
)
{
char
buffer
[
MAX_FIELD_WIDTH
];
String
*
res
=
args
[
0
]
->
val_str
(
str
);
if
(
!
res
)
// Null value
update_hash
((
void
*
)
0
,
0
,
STRING_RESULT
);
else
update_hash
(
res
->
c_ptr
(),
res
->
length
()
+
1
,
STRING_RESULT
);
return
res
;
}
String
*
Item_func_set_user_var
::
native_val_str
()
{
char
buffer
[
MAX_FIELD_WIDTH
];
String
tmp
(
buffer
,
sizeof
(
buffer
));
return
native_val_str
(
&
tmp
);
}
bool
bool
Item_func_set_user_var
::
update
()
Item_func_set_user_var
::
update
()
{
{
...
...
sql/item_func.h
View file @
d7e308c6
...
@@ -889,10 +889,37 @@ class Item_func_set_user_var :public Item_func
...
@@ -889,10 +889,37 @@ class Item_func_set_user_var :public Item_func
LEX_STRING
name
;
LEX_STRING
name
;
user_var_entry
*
entry
;
user_var_entry
*
entry
;
double
native_val
();
double
native_val
()
longlong
native_val_int
();
{
String
*
native_val_str
(
String
*
str
);
double
value
=
args
[
0
]
->
val
();
String
*
native_val_str
();
update_hash
((
void
*
)
&
value
,
sizeof
(
value
),
REAL_RESULT
);
return
value
;
}
longlong
native_val_int
()
{
longlong
value
=
args
[
0
]
->
val_int
();
update_hash
((
void
*
)
&
value
,
sizeof
(
longlong
),
INT_RESULT
);
return
value
;
}
String
*
native_val_str
(
String
*
str
)
{
char
buffer
[
MAX_FIELD_WIDTH
];
String
*
res
=
args
[
0
]
->
val_str
(
str
);
if
(
!
res
)
// Null value
update_hash
((
void
*
)
0
,
0
,
STRING_RESULT
);
else
update_hash
(
res
->
c_ptr
(),
res
->
length
()
+
1
,
STRING_RESULT
);
return
res
;
}
String
*
native_val_str
()
{
char
buffer
[
MAX_FIELD_WIDTH
];
String
tmp
(
buffer
,
sizeof
(
buffer
));
return
native_val_str
(
&
tmp
);
}
public:
public:
Item_func_set_user_var
(
LEX_STRING
a
,
Item
*
b
)
:
Item_func
(
b
),
name
(
a
)
{}
Item_func_set_user_var
(
LEX_STRING
a
,
Item
*
b
)
:
Item_func
(
b
),
name
(
a
)
{}
...
...
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