Handler_commit STATUS variable not correctly incremented

Bug #535296 reported by Jay Pipes on 2010-03-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Medium
Jay Pipes

Bug Description

Given this test case and result:
test:

# This is a test of various SQL statements
# and looks at the statement and transaction
# boundaries (start/end) to ensure they are sane

SET AUTOCOMMIT= 0;

# Expect 0 commit count since nothing
# has yet happened...

SHOW STATUS LIKE 'Handler_commit%';

BEGIN;

# Expect 0 commit count since nothing
# has yet been committed...

SHOW STATUS LIKE 'Handler_commit%';

DROP SCHEMA IF EXISTS boundaries;

# Expect 0 commit count since nothing
# has yet been committed...

SHOW STATUS LIKE 'Handler_commit%';

COMMIT;

# Expect 1 commit count since
# an explicit call to COMMIT was made
# even though nothing was changed...

SHOW STATUS LIKE 'Handler_commit%';

result:

SET AUTOCOMMIT= 0;
SHOW STATUS LIKE 'Handler_commit%';
Variable_name Value
Handler_commit 0
BEGIN;
SHOW STATUS LIKE 'Handler_commit%';
Variable_name Value
Handler_commit 0
DROP SCHEMA IF EXISTS boundaries;
Warnings:
Note 1008 Can't drop database './boundaries/'; database doesn't exist
SHOW STATUS LIKE 'Handler_commit%';
Variable_name Value
Handler_commit 0
COMMIT;
SHOW STATUS LIKE 'Handler_commit%';
Variable_name Value
Handler_commit 1

We get a failure with Handler_commit not being incremented correctly:

main.statement_boundaries [ fail ] --- /home/jpipes/repos/drizzle/remove-statement-transaction/tests/r/statement_boundaries.result 2010-03-09 22:37:40.772277979 +0300
+++ /home/jpipes/repos/drizzle/remove-statement-transaction/tests/r/statement_boundaries.reject 2010-03-09 22:37:47.612278798 +0300
@@ -5,14 +5,14 @@
 BEGIN;
 SHOW STATUS LIKE 'Handler_commit%';
 Variable_name Value
-Handler_commit 0
+Handler_commit 1
 DROP SCHEMA IF EXISTS boundaries;
 Warnings:
 Note 1008 Can't drop database './boundaries/'; database doesn't exist
 SHOW STATUS LIKE 'Handler_commit%';
 Variable_name Value
-Handler_commit 0
+Handler_commit 2
 COMMIT;
 SHOW STATUS LIKE 'Handler_commit%';
 Variable_name Value
-Handler_commit 1
+Handler_commit 2

Tags: ddl Edit Tag help

Related branches

Jay Pipes (jaypipes) wrote :

This is the result of not having proper statement and transaction boundaries for DDL operations. :(

Jay Pipes (jaypipes) wrote :

Note that ha_commit_count is being incremented regardless of whether it is a "statement" or normal transaction

Changed in drizzle:
assignee: nobody → Jay Pipes (jaypipes)
Jay Pipes (jaypipes) wrote :

Note that it is not possible to have the result file above return the "correct" results until transactional DDL is in place. In the meantime, fix the TransactionServices component to only increment ha_commit_count if it's a "normal" transaction.

Jay Pipes (jaypipes) on 2010-03-09
Changed in drizzle:
status: Confirmed → Fix Committed
Jay Pipes (jaypipes) on 2010-03-12
Changed in drizzle:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers