summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <kostja@bodhi.(none)>2007-10-15 16:42:41 +0400
committerunknown <kostja@bodhi.(none)>2007-10-15 16:42:41 +0400
commit4db46e26f31abd5c2bafd3349251491ee1e4eb60 (patch)
treea00cd509e44dcc881c3f63e807a3da9eefe41a7f /sql
parent73458352133ac1d2660e60e84b96d3659cff399a (diff)
downloadmariadb-git-4db46e26f31abd5c2bafd3349251491ee1e4eb60.tar.gz
Add comments, tidy up sql_delete.cc to refer to thd->row_count_func
explicitly. sql/sql_class.cc: Add comments. sql/sql_delete.cc: Change syntax to make grepping easier. No semantical change.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_class.cc12
-rw-r--r--sql/sql_delete.cc8
2 files changed, 16 insertions, 4 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 09c8a79c15e..893ecf88a96 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1423,7 +1423,14 @@ bool select_to_file::send_eof()
if (my_close(file,MYF(MY_WME)))
error= 1;
if (!error)
+ {
+ /*
+ In order to remember the value of affected rows for ROW_COUNT()
+ function, SELECT INTO has to have an own SQLCOM.
+ TODO: split from SQLCOM_SELECT
+ */
::send_ok(thd,row_count);
+ }
file= -1;
return error;
}
@@ -2338,6 +2345,11 @@ bool select_dumpvar::send_eof()
if (! row_count)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_SP_FETCH_NO_DATA, ER(ER_SP_FETCH_NO_DATA));
+ /*
+ In order to remember the value of affected rows for ROW_COUNT()
+ function, SELECT INTO has to have an own SQLCOM.
+ TODO: split from SQLCOM_SELECT
+ */
::send_ok(thd,row_count);
return 0;
}
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 303918f42a2..4c57fad8d87 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -142,7 +142,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
{
free_underlaid_joins(thd, select_lex);
thd->row_count_func= 0;
- send_ok(thd); // No matching records
+ send_ok(thd, (ha_rows) thd->row_count_func); // No matching records
DBUG_RETURN(0);
}
#endif
@@ -159,7 +159,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
delete select;
free_underlaid_joins(thd, select_lex);
thd->row_count_func= 0;
- send_ok(thd,0L);
+ send_ok(thd, (ha_rows) thd->row_count_func);
/*
We don't need to call reset_auto_increment in this case, because
mysql_truncate always gives a NULL conds argument, hence we never
@@ -386,7 +386,7 @@ cleanup:
if (error < 0 || (thd->lex->ignore && !thd->is_fatal_error))
{
thd->row_count_func= deleted;
- send_ok(thd,deleted);
+ send_ok(thd, (ha_rows) thd->row_count_func);
DBUG_PRINT("info",("%ld records deleted",(long) deleted));
}
DBUG_RETURN(error >= 0 || thd->net.report_error);
@@ -889,7 +889,7 @@ bool multi_delete::send_eof()
if (!local_error)
{
thd->row_count_func= deleted;
- ::send_ok(thd, deleted);
+ ::send_ok(thd, (ha_rows) thd->row_count_func);
}
return 0;
}