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
e29a4dd5
Commit
e29a4dd5
authored
Mar 26, 2014
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-5433 select_result::send_error() is unused
remove dead code
parent
707dd6b9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
88 deletions
+4
-88
sql/sql_class.cc
sql/sql_class.cc
+0
-20
sql/sql_class.h
sql/sql_class.h
+2
-8
sql/sql_delete.cc
sql/sql_delete.cc
+1
-12
sql/sql_insert.cc
sql/sql_insert.cc
+0
-40
sql/sql_update.cc
sql/sql_update.cc
+1
-8
No files found.
sql/sql_class.cc
View file @
e29a4dd5
...
@@ -2439,12 +2439,6 @@ select_result::select_result()
...
@@ -2439,12 +2439,6 @@ select_result::select_result()
thd
=
current_thd
;
thd
=
current_thd
;
}
}
void
select_result
::
send_error
(
uint
errcode
,
const
char
*
err
)
{
my_message
(
errcode
,
err
,
MYF
(
0
));
}
void
select_result
::
cleanup
()
void
select_result
::
cleanup
()
{
{
/* do nothing */
/* do nothing */
...
@@ -2586,20 +2580,6 @@ bool select_send::send_eof()
...
@@ -2586,20 +2580,6 @@ bool select_send::send_eof()
Handling writing to file
Handling writing to file
************************************************************************/
************************************************************************/
void
select_to_file
::
send_error
(
uint
errcode
,
const
char
*
err
)
{
my_message
(
errcode
,
err
,
MYF
(
0
));
if
(
file
>
0
)
{
(
void
)
end_io_cache
(
&
cache
);
mysql_file_close
(
file
,
MYF
(
0
));
/* Delete file on error */
mysql_file_delete
(
key_select_to_file
,
path
,
MYF
(
0
));
file
=
-
1
;
}
}
bool
select_to_file
::
send_eof
()
bool
select_to_file
::
send_eof
()
{
{
int
error
=
MY_TEST
(
end_io_cache
(
&
cache
));
int
error
=
MY_TEST
(
end_io_cache
(
&
cache
));
...
...
sql/sql_class.h
View file @
e29a4dd5
...
@@ -3838,7 +3838,6 @@ public:
...
@@ -3838,7 +3838,6 @@ public:
{
return
fields
.
elements
;
}
{
return
fields
.
elements
;
}
virtual
bool
send_result_set_metadata
(
List
<
Item
>
&
list
,
uint
flags
)
=
0
;
virtual
bool
send_result_set_metadata
(
List
<
Item
>
&
list
,
uint
flags
)
=
0
;
virtual
bool
initialize_tables
(
JOIN
*
join
=
0
)
{
return
0
;
}
virtual
bool
initialize_tables
(
JOIN
*
join
=
0
)
{
return
0
;
}
virtual
void
send_error
(
uint
errcode
,
const
char
*
err
);
virtual
bool
send_eof
()
=
0
;
virtual
bool
send_eof
()
=
0
;
/**
/**
Check if this query returns a result set and therefore is allowed in
Check if this query returns a result set and therefore is allowed in
...
@@ -3965,7 +3964,6 @@ public:
...
@@ -3965,7 +3964,6 @@ public:
select_to_file
(
sql_exchange
*
ex
)
:
exchange
(
ex
),
file
(
-
1
),
row_count
(
0L
)
select_to_file
(
sql_exchange
*
ex
)
:
exchange
(
ex
),
file
(
-
1
),
row_count
(
0L
)
{
path
[
0
]
=
0
;
}
{
path
[
0
]
=
0
;
}
~
select_to_file
();
~
select_to_file
();
void
send_error
(
uint
errcode
,
const
char
*
err
);
bool
send_eof
();
bool
send_eof
();
void
cleanup
();
void
cleanup
();
};
};
...
@@ -4038,7 +4036,6 @@ class select_insert :public select_result_interceptor {
...
@@ -4038,7 +4036,6 @@ class select_insert :public select_result_interceptor {
virtual
int
send_data
(
List
<
Item
>
&
items
);
virtual
int
send_data
(
List
<
Item
>
&
items
);
virtual
void
store_values
(
List
<
Item
>
&
values
);
virtual
void
store_values
(
List
<
Item
>
&
values
);
virtual
bool
can_rollback_data
()
{
return
0
;
}
virtual
bool
can_rollback_data
()
{
return
0
;
}
void
send_error
(
uint
errcode
,
const
char
*
err
);
bool
send_eof
();
bool
send_eof
();
virtual
void
abort_result_set
();
virtual
void
abort_result_set
();
/* not implemented: select_insert is never re-used in prepared statements */
/* not implemented: select_insert is never re-used in prepared statements */
...
@@ -4076,7 +4073,6 @@ public:
...
@@ -4076,7 +4073,6 @@ public:
int
binlog_show_create_table
(
TABLE
**
tables
,
uint
count
);
int
binlog_show_create_table
(
TABLE
**
tables
,
uint
count
);
void
store_values
(
List
<
Item
>
&
values
);
void
store_values
(
List
<
Item
>
&
values
);
void
send_error
(
uint
errcode
,
const
char
*
err
);
bool
send_eof
();
bool
send_eof
();
virtual
void
abort_result_set
();
virtual
void
abort_result_set
();
virtual
bool
can_rollback_data
()
{
return
1
;
}
virtual
bool
can_rollback_data
()
{
return
1
;
}
...
@@ -4594,7 +4590,7 @@ class multi_delete :public select_result_interceptor
...
@@ -4594,7 +4590,7 @@ class multi_delete :public select_result_interceptor
bool
delete_while_scanning
;
bool
delete_while_scanning
;
/*
/*
error handling (rollback and binlogging) can happen in send_eof()
error handling (rollback and binlogging) can happen in send_eof()
so that afterward
send_error
() needs to find out that.
so that afterward
abort_result_set
() needs to find out that.
*/
*/
bool
error_handled
;
bool
error_handled
;
...
@@ -4604,7 +4600,6 @@ public:
...
@@ -4604,7 +4600,6 @@ public:
int
prepare
(
List
<
Item
>
&
list
,
SELECT_LEX_UNIT
*
u
);
int
prepare
(
List
<
Item
>
&
list
,
SELECT_LEX_UNIT
*
u
);
int
send_data
(
List
<
Item
>
&
items
);
int
send_data
(
List
<
Item
>
&
items
);
bool
initialize_tables
(
JOIN
*
join
);
bool
initialize_tables
(
JOIN
*
join
);
void
send_error
(
uint
errcode
,
const
char
*
err
);
int
do_deletes
();
int
do_deletes
();
int
do_table_deletes
(
TABLE
*
table
,
bool
ignore
);
int
do_table_deletes
(
TABLE
*
table
,
bool
ignore
);
bool
send_eof
();
bool
send_eof
();
...
@@ -4640,7 +4635,7 @@ class multi_update :public select_result_interceptor
...
@@ -4640,7 +4635,7 @@ class multi_update :public select_result_interceptor
bool
ignore
;
bool
ignore
;
/*
/*
error handling (rollback and binlogging) can happen in send_eof()
error handling (rollback and binlogging) can happen in send_eof()
so that afterward
send_error
() needs to find out that.
so that afterward
abort_result_set
() needs to find out that.
*/
*/
bool
error_handled
;
bool
error_handled
;
...
@@ -4654,7 +4649,6 @@ public:
...
@@ -4654,7 +4649,6 @@ public:
int
prepare
(
List
<
Item
>
&
list
,
SELECT_LEX_UNIT
*
u
);
int
prepare
(
List
<
Item
>
&
list
,
SELECT_LEX_UNIT
*
u
);
int
send_data
(
List
<
Item
>
&
items
);
int
send_data
(
List
<
Item
>
&
items
);
bool
initialize_tables
(
JOIN
*
join
);
bool
initialize_tables
(
JOIN
*
join
);
void
send_error
(
uint
errcode
,
const
char
*
err
);
int
do_updates
();
int
do_updates
();
bool
send_eof
();
bool
send_eof
();
inline
ha_rows
num_found
()
inline
ha_rows
num_found
()
...
...
sql/sql_delete.cc
View file @
e29a4dd5
...
@@ -1047,17 +1047,6 @@ int multi_delete::send_data(List<Item> &values)
...
@@ -1047,17 +1047,6 @@ int multi_delete::send_data(List<Item> &values)
}
}
void
multi_delete
::
send_error
(
uint
errcode
,
const
char
*
err
)
{
DBUG_ENTER
(
"multi_delete::send_error"
);
/* First send error what ever it is ... */
my_message
(
errcode
,
err
,
MYF
(
0
));
DBUG_VOID_RETURN
;
}
void
multi_delete
::
abort_result_set
()
void
multi_delete
::
abort_result_set
()
{
{
DBUG_ENTER
(
"multi_delete::abort_result_set"
);
DBUG_ENTER
(
"multi_delete::abort_result_set"
);
...
@@ -1292,7 +1281,7 @@ bool multi_delete::send_eof()
...
@@ -1292,7 +1281,7 @@ bool multi_delete::send_eof()
}
}
}
}
if
(
local_error
!=
0
)
if
(
local_error
!=
0
)
error_handled
=
TRUE
;
// to force early leave from ::
send_error
()
error_handled
=
TRUE
;
// to force early leave from ::
abort_result_set
()
if
(
!
local_error
)
if
(
!
local_error
)
{
{
...
...
sql/sql_insert.cc
View file @
e29a4dd5
...
@@ -3636,16 +3636,6 @@ void select_insert::store_values(List<Item> &values)
...
@@ -3636,16 +3636,6 @@ void select_insert::store_values(List<Item> &values)
TRG_EVENT_INSERT
);
TRG_EVENT_INSERT
);
}
}
void
select_insert
::
send_error
(
uint
errcode
,
const
char
*
err
)
{
DBUG_ENTER
(
"select_insert::send_error"
);
my_message
(
errcode
,
err
,
MYF
(
0
));
DBUG_VOID_RETURN
;
}
bool
select_insert
::
send_eof
()
bool
select_insert
::
send_eof
()
{
{
int
error
;
int
error
;
...
@@ -4198,36 +4188,6 @@ void select_create::store_values(List<Item> &values)
...
@@ -4198,36 +4188,6 @@ void select_create::store_values(List<Item> &values)
}
}
void
select_create
::
send_error
(
uint
errcode
,
const
char
*
err
)
{
DBUG_ENTER
(
"select_create::send_error"
);
DBUG_PRINT
(
"info"
,
(
"Current statement %s row-based"
,
thd
->
is_current_stmt_binlog_format_row
()
?
"is"
:
"is NOT"
));
DBUG_PRINT
(
"info"
,
(
"Current table (at 0x%lu) %s a temporary (or non-existant) table"
,
(
ulong
)
table
,
table
&&
!
table
->
s
->
tmp_table
?
"is NOT"
:
"is"
));
/*
This will execute any rollbacks that are necessary before writing
the transcation cache.
We disable the binary log since nothing should be written to the
binary log. This disabling is important, since we potentially do
a "roll back" of non-transactional tables by removing the table,
and the actual rollback might generate events that should not be
written to the binary log.
*/
tmp_disable_binlog
(
thd
);
select_insert
::
send_error
(
errcode
,
err
);
reenable_binlog
(
thd
);
DBUG_VOID_RETURN
;
}
bool
select_create
::
send_eof
()
bool
select_create
::
send_eof
()
{
{
if
(
select_insert
::
send_eof
())
if
(
select_insert
::
send_eof
())
...
...
sql/sql_update.cc
View file @
e29a4dd5
...
@@ -2077,13 +2077,6 @@ int multi_update::send_data(List<Item> ¬_used_values)
...
@@ -2077,13 +2077,6 @@ int multi_update::send_data(List<Item> ¬_used_values)
}
}
void
multi_update
::
send_error
(
uint
errcode
,
const
char
*
err
)
{
/* First send error what ever it is ... */
my_error
(
errcode
,
MYF
(
0
),
err
);
}
void
multi_update
::
abort_result_set
()
void
multi_update
::
abort_result_set
()
{
{
/* the error was handled or nothing deleted and no side effects return */
/* the error was handled or nothing deleted and no side effects return */
...
@@ -2406,7 +2399,7 @@ bool multi_update::send_eof()
...
@@ -2406,7 +2399,7 @@ bool multi_update::send_eof()
thd
->
transaction
.
stmt
.
modified_non_trans_table
);
thd
->
transaction
.
stmt
.
modified_non_trans_table
);
if
(
local_error
!=
0
)
if
(
local_error
!=
0
)
error_handled
=
TRUE
;
// to force early leave from ::
send_error
()
error_handled
=
TRUE
;
// to force early leave from ::
abort_result_set
()
if
(
local_error
>
0
)
// if the above log write did not fail ...
if
(
local_error
>
0
)
// if the above log write did not fail ...
{
{
...
...
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