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
5f980d93
Commit
5f980d93
authored
Nov 21, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made Item_splocal printable.
sql/sp_head.cc: Fixed bug that showed up when using running with --debug.
parent
de0eec17
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
8 deletions
+34
-8
sql/item.h
sql/item.h
+8
-2
sql/sp_head.cc
sql/sp_head.cc
+18
-3
sql/sql_class.cc
sql/sql_class.cc
+1
-1
sql/sql_yacc.yy
sql/sql_yacc.yy
+7
-2
No files found.
sql/item.h
View file @
5f980d93
...
...
@@ -230,11 +230,12 @@ class Item_splocal : public Item
private:
uint
m_offset
;
LEX_STRING
m_name
;
public:
Item_splocal
(
uint
offset
)
:
m_offset
(
offset
)
Item_splocal
(
LEX_STRING
name
,
uint
offset
)
:
m_offset
(
offset
)
,
m_name
(
name
)
{
Item
::
maybe_null
=
TRUE
;
}
...
...
@@ -305,6 +306,11 @@ class Item_splocal : public Item
{
return
this_item
()
->
save_in_field
(
field
,
no_conversions
);
}
inline
void
print
(
String
*
str
)
{
str
->
append
(
m_name
.
str
,
m_name
.
length
);
}
};
...
...
sql/sp_head.cc
View file @
5f980d93
...
...
@@ -70,22 +70,32 @@ sp_eval_func_item(THD *thd, Item *it, enum enum_field_types type)
{
longlong
i
=
it
->
val_int
();
DBUG_PRINT
(
"info"
,
(
"INT_RESULT: %d"
,
i
));
if
(
it
->
null_value
)
{
DBUG_PRINT
(
"info"
,
(
"INT_RESULT: null"
));
it
=
new
Item_null
();
}
else
{
DBUG_PRINT
(
"info"
,
(
"INT_RESULT: %d"
,
i
));
it
=
new
Item_int
(
it
->
val_int
());
}
break
;
}
case
REAL_RESULT
:
{
double
d
=
it
->
val
();
DBUG_PRINT
(
"info"
,
(
"REAL_RESULT: %g"
,
d
));
if
(
it
->
null_value
)
{
DBUG_PRINT
(
"info"
,
(
"REAL_RESULT: null"
));
it
=
new
Item_null
();
}
else
{
DBUG_PRINT
(
"info"
,
(
"REAL_RESULT: %g"
,
d
));
it
=
new
Item_real
(
it
->
val
());
}
break
;
}
default:
...
...
@@ -94,12 +104,17 @@ sp_eval_func_item(THD *thd, Item *it, enum enum_field_types type)
String
tmp
(
buffer
,
sizeof
(
buffer
),
it
->
collation
.
collation
);
String
*
s
=
it
->
val_str
(
&
tmp
);
DBUG_PRINT
(
"info"
,(
"default result: %*s"
,
s
->
length
(),
s
->
c_ptr_quick
()));
if
(
it
->
null_value
)
{
DBUG_PRINT
(
"info"
,
(
"default result: null"
));
it
=
new
Item_null
();
}
else
{
DBUG_PRINT
(
"info"
,(
"default result: %*s"
,
s
->
length
(),
s
->
c_ptr_quick
()));
it
=
new
Item_string
(
thd
->
strmake
(
s
->
c_ptr_quick
(),
s
->
length
()),
s
->
length
(),
it
->
collation
.
collation
);
}
break
;
}
}
...
...
sql/sql_class.cc
View file @
5f980d93
...
...
@@ -1205,7 +1205,7 @@ int select_dumpvar::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
{
my_var
*
mv
=
gl
++
;
if
(
mv
->
local
)
(
void
)
local_vars
.
push_back
(
new
Item_splocal
(
mv
->
offset
));
(
void
)
local_vars
.
push_back
(
new
Item_splocal
(
mv
->
s
,
mv
->
offset
));
else
{
Item_func_set_user_var
*
xx
=
new
Item_func_set_user_var
(
mv
->
s
,
item
);
...
...
sql/sql_yacc.yy
View file @
5f980d93
...
...
@@ -1775,7 +1775,12 @@ sp_case:
i= new sp_instr_jump_if_not(ip, $1);
else
{ /* Simple case: <caseval> = <whenval> */
Item *var= (Item*) new Item_splocal(ctx->current_framesize()-1);
LEX_STRING ivar;
ivar.str= "_tmp_";
ivar.length= 5;
Item *var= (Item*) new Item_splocal(ivar,
ctx->current_framesize()-1);
Item *expr= new Item_func_eq(var, $1);
i= new sp_instr_jump_if_not(ip, expr);
...
...
@@ -5507,7 +5512,7 @@ simple_ident:
YYABORT;
}
else
$$ = (Item*) new Item_splocal(spv->offset);
$$ = (Item*) new Item_splocal(
$1,
spv->offset);
}
else
{
...
...
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