Commit 46c19805 authored by Timothy Smith's avatar Timothy Smith

Completing snapshot innodb-5.1-ss2438, part 1. Fixes

Bug #35537: Innodb doesn't increment handler_update and handler_delete


Detailed revision comments:

r2388 | vasil | 2008-03-27 14:02:34 +0200 (Thu, 27 Mar 2008) | 7 lines
branches/5.1:

Swap the order in which mysql_thd, mysql_query_str and *mysql_query_str
are checked for non-NULL.

Suggested by:	Marko

r2421 | calvin | 2008-04-24 15:32:30 +0300 (Thu, 24 Apr 2008) | 6 lines
branches/5.1: Fix bug#35537 - Innodb doesn't increment handler_update
and handler_delete

Add the calls to ha_statistic_increment() in ha_innobase::delete_row()
and ha_innobase::update_row().
parent 24598b43
......@@ -3295,3 +3295,11 @@ info: Records: 5 Duplicates: 0 Warnings: 0
TRUNCATE TABLE t1;
affected rows: 0
DROP TABLE t1;
Variable_name Value
Handler_update 0
Variable_name Value
Handler_delete 0
Variable_name Value
Handler_update 1
Variable_name Value
Handler_delete 1
......@@ -2475,6 +2475,7 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
DROP TABLE t2;
DROP TABLE t1;
# End 34920 test
#
# Bug #29507 TRUNCATE shows to many rows effected
#
CONNECTION default;
......@@ -2491,6 +2492,36 @@ TRUNCATE TABLE t1;
--disable_info
DROP TABLE t1;
#
# Bug#35537 Innodb doesn't increment handler_update and handler_delete.
#
-- disable_query_log
-- disable_result_log
CONNECT (c1,localhost,root,,);
DROP TABLE IF EXISTS bug35537;
CREATE TABLE bug35537 (
c1 int
) ENGINE=InnoDB;
INSERT INTO bug35537 VALUES (1);
-- enable_result_log
SHOW SESSION STATUS LIKE 'Handler_update%';
SHOW SESSION STATUS LIKE 'Handler_delete%';
UPDATE bug35537 SET c1 = 2 WHERE c1 = 1;
DELETE FROM bug35537 WHERE c1 = 2;
SHOW SESSION STATUS LIKE 'Handler_update%';
SHOW SESSION STATUS LIKE 'Handler_delete%';
DROP TABLE bug35537;
DISCONNECT c1;
CONNECTION default;
#######################################################################
# #
# Please, DO NOT TOUCH this file as well as the innodb.result file. #
......
......@@ -3755,6 +3755,8 @@ ha_innobase::update_row(
ut_a(prebuilt->trx == trx);
ha_statistic_increment(&SSV::ha_update_count);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
table->timestamp_field->set_time();
......@@ -3844,6 +3846,8 @@ ha_innobase::delete_row(
ut_a(prebuilt->trx == trx);
ha_statistic_increment(&SSV::ha_delete_count);
/* Only if the table has an AUTOINC column */
if (table->found_next_number_field && record == table->record[0]) {
ulonglong dummy = 0;
......
......@@ -3577,9 +3577,9 @@ row_search_for_mysql(
if (trx->isolation_level <= TRX_ISO_READ_COMMITTED
&& prebuilt->select_lock_type != LOCK_NONE
&& trx->mysql_thd != NULL
&& trx->mysql_query_str != NULL
&& *trx->mysql_query_str != NULL
&& trx->mysql_thd != NULL) {
&& *trx->mysql_query_str != NULL) {
/* Scan the MySQL query string; check if SELECT is the first
word there */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment