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
37abf689
Commit
37abf689
authored
Jan 20, 2004
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pack of changes about 'cleanup()'-s
Some errorneous code trimmed
parent
7dda8c10
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
16 deletions
+19
-16
sql/item.cc
sql/item.cc
+2
-1
sql/item.h
sql/item.h
+12
-1
sql/item_row.h
sql/item_row.h
+0
-10
sql/item_sum.cc
sql/item_sum.cc
+1
-0
sql/item_sum.h
sql/item_sum.h
+3
-3
sql/sql_parse.cc
sql/sql_parse.cc
+1
-1
No files found.
sql/item.cc
View file @
37abf689
...
@@ -2024,7 +2024,8 @@ void Item_cache_row::bring_value()
...
@@ -2024,7 +2024,8 @@ void Item_cache_row::bring_value()
Item_type_holder
::
Item_type_holder
(
THD
*
thd
,
Item
*
item
)
Item_type_holder
::
Item_type_holder
(
THD
*
thd
,
Item
*
item
)
:
Item
(
thd
,
item
),
item_type
(
item
->
result_type
())
:
Item
(
thd
,
item
),
item_type
(
item
->
result_type
()),
orig_type
(
item_type
)
{
{
DBUG_ASSERT
(
item
->
fixed
);
DBUG_ASSERT
(
item
->
fixed
);
...
...
sql/item.h
View file @
37abf689
...
@@ -125,7 +125,7 @@ public:
...
@@ -125,7 +125,7 @@ public:
optimisation changes in prepared statements
optimisation changes in prepared statements
*/
*/
Item
(
THD
*
thd
,
Item
*
item
);
Item
(
THD
*
thd
,
Item
*
item
);
virtual
~
Item
()
{
name
=
0
;
cleanup
();
}
/*lint -e1509 */
virtual
~
Item
()
{
name
=
0
;
}
/*lint -e1509 */
void
set_name
(
const
char
*
str
,
uint
length
,
CHARSET_INFO
*
cs
);
void
set_name
(
const
char
*
str
,
uint
length
,
CHARSET_INFO
*
cs
);
void
init_make_field
(
Send_field
*
tmp_field
,
enum
enum_field_types
type
);
void
init_make_field
(
Send_field
*
tmp_field
,
enum
enum_field_types
type
);
virtual
void
cleanup
()
{
fixed
=
0
;
}
virtual
void
cleanup
()
{
fixed
=
0
;
}
...
@@ -227,6 +227,11 @@ public:
...
@@ -227,6 +227,11 @@ public:
/* Used in sql_select.cc:eliminate_not_funcs() */
/* Used in sql_select.cc:eliminate_not_funcs() */
virtual
Item
*
neg_transformer
()
{
return
NULL
;
}
virtual
Item
*
neg_transformer
()
{
return
NULL
;
}
void
delete_self
()
{
cleanup
();
delete
this
;
}
};
};
...
@@ -1003,6 +1008,7 @@ class Item_type_holder: public Item
...
@@ -1003,6 +1008,7 @@ class Item_type_holder: public Item
{
{
protected:
protected:
Item_result
item_type
;
Item_result
item_type
;
Item_result
orig_type
;
Field
*
field_example
;
Field
*
field_example
;
public:
public:
Item_type_holder
(
THD
*
,
Item
*
);
Item_type_holder
(
THD
*
,
Item
*
);
...
@@ -1014,6 +1020,11 @@ public:
...
@@ -1014,6 +1020,11 @@ public:
String
*
val_str
(
String
*
);
String
*
val_str
(
String
*
);
bool
join_types
(
THD
*
thd
,
Item
*
);
bool
join_types
(
THD
*
thd
,
Item
*
);
Field
*
example
()
{
return
field_example
;
}
Field
*
example
()
{
return
field_example
;
}
void
cleanup
()
{
Item
::
cleanup
();
item_type
=
orig_type
;
}
};
};
...
...
sql/item_row.h
View file @
37abf689
...
@@ -34,16 +34,6 @@ public:
...
@@ -34,16 +34,6 @@ public:
with_null
(
0
)
with_null
(
0
)
{}
{}
void
cleanup
()
{
if
(
array_holder
&&
items
)
{
sql_element_free
(
items
);
items
=
0
;
array_holder
=
0
;
}
}
enum
Type
type
()
const
{
return
ROW_ITEM
;
};
enum
Type
type
()
const
{
return
ROW_ITEM
;
};
void
illegal_method_call
(
const
char
*
);
void
illegal_method_call
(
const
char
*
);
bool
is_null
()
{
return
null_value
;
}
bool
is_null
()
{
return
null_value
;
}
...
...
sql/item_sum.cc
View file @
37abf689
...
@@ -1097,6 +1097,7 @@ void Item_sum_count_distinct::cleanup()
...
@@ -1097,6 +1097,7 @@ void Item_sum_count_distinct::cleanup()
if
(
use_tree
)
if
(
use_tree
)
delete_tree
(
tree
);
delete_tree
(
tree
);
table
=
0
;
table
=
0
;
use_tree
=
0
;
}
}
}
}
...
...
sql/item_sum.h
View file @
37abf689
...
@@ -610,7 +610,7 @@ class Item_sum_udf_float :public Item_sum_num
...
@@ -610,7 +610,7 @@ class Item_sum_udf_float :public Item_sum_num
public:
public:
Item_sum_udf_float
(
udf_func
*
udf_arg
)
:
Item_sum_num
()
{}
Item_sum_udf_float
(
udf_func
*
udf_arg
)
:
Item_sum_num
()
{}
Item_sum_udf_float
(
udf_func
*
udf_arg
,
List
<
Item
>
&
list
)
:
Item_sum_num
()
{}
Item_sum_udf_float
(
udf_func
*
udf_arg
,
List
<
Item
>
&
list
)
:
Item_sum_num
()
{}
Item_sum_udf_float
(
THD
*
thd
,
Item_sum_udf_float
&
item
)
Item_sum_udf_float
(
THD
*
thd
,
Item_sum_udf_float
*
item
)
:
Item_sum_num
(
thd
,
item
)
{}
:
Item_sum_num
(
thd
,
item
)
{}
enum
Sumfunctype
sum_func
()
const
{
return
UDF_SUM_FUNC
;
}
enum
Sumfunctype
sum_func
()
const
{
return
UDF_SUM_FUNC
;
}
double
val
()
{
return
0.0
;
}
double
val
()
{
return
0.0
;
}
...
@@ -625,7 +625,7 @@ class Item_sum_udf_int :public Item_sum_num
...
@@ -625,7 +625,7 @@ class Item_sum_udf_int :public Item_sum_num
public:
public:
Item_sum_udf_int
(
udf_func
*
udf_arg
)
:
Item_sum_num
()
{}
Item_sum_udf_int
(
udf_func
*
udf_arg
)
:
Item_sum_num
()
{}
Item_sum_udf_int
(
udf_func
*
udf_arg
,
List
<
Item
>
&
list
)
:
Item_sum_num
()
{}
Item_sum_udf_int
(
udf_func
*
udf_arg
,
List
<
Item
>
&
list
)
:
Item_sum_num
()
{}
Item_sum_udf_int
(
THD
*
thd
,
Item_sum_udf_int
&
item
)
Item_sum_udf_int
(
THD
*
thd
,
Item_sum_udf_int
*
item
)
:
Item_sum_num
(
thd
,
item
)
{}
:
Item_sum_num
(
thd
,
item
)
{}
enum
Sumfunctype
sum_func
()
const
{
return
UDF_SUM_FUNC
;
}
enum
Sumfunctype
sum_func
()
const
{
return
UDF_SUM_FUNC
;
}
longlong
val_int
()
{
return
0
;
}
longlong
val_int
()
{
return
0
;
}
...
@@ -641,7 +641,7 @@ class Item_sum_udf_str :public Item_sum_num
...
@@ -641,7 +641,7 @@ class Item_sum_udf_str :public Item_sum_num
public:
public:
Item_sum_udf_str
(
udf_func
*
udf_arg
)
:
Item_sum_num
()
{}
Item_sum_udf_str
(
udf_func
*
udf_arg
)
:
Item_sum_num
()
{}
Item_sum_udf_str
(
udf_func
*
udf_arg
,
List
<
Item
>
&
list
)
:
Item_sum_num
()
{}
Item_sum_udf_str
(
udf_func
*
udf_arg
,
List
<
Item
>
&
list
)
:
Item_sum_num
()
{}
Item_sum_udf_str
(
THD
*
thd
,
Item_sum_udf_str
&
item
)
Item_sum_udf_str
(
THD
*
thd
,
Item_sum_udf_str
*
item
)
:
Item_sum_num
(
thd
,
item
)
{}
:
Item_sum_num
(
thd
,
item
)
{}
String
*
val_str
(
String
*
)
{
null_value
=
1
;
return
0
;
}
String
*
val_str
(
String
*
)
{
null_value
=
1
;
return
0
;
}
double
val
()
{
null_value
=
1
;
return
0.0
;
}
double
val
()
{
null_value
=
1
;
return
0.0
;
}
...
...
sql/sql_parse.cc
View file @
37abf689
...
@@ -1109,7 +1109,7 @@ end:
...
@@ -1109,7 +1109,7 @@ end:
void
free_items
(
Item
*
item
)
void
free_items
(
Item
*
item
)
{
{
for
(;
item
;
item
=
item
->
next
)
for
(;
item
;
item
=
item
->
next
)
delete
item
;
item
->
delete_self
()
;
}
}
/* This works because items are allocated with sql_alloc() */
/* This works because items are allocated with sql_alloc() */
...
...
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