Merge lp:~vkolesnikov/pbxt/pbxt-bug-499026 into lp:pbxt

Proposed by Vladimir Kolesnikov
Status: Merged
Merged at revision: not available
Proposed branch: lp:~vkolesnikov/pbxt/pbxt-bug-499026
Merge into: lp:pbxt
Diff against target: 273 lines (+211/-1)
6 files modified
ChangeLog (+2/-0)
src/ha_pbxt.cc (+24/-0)
test/mysql-test/pbxt-test-run.pl (+3/-1)
test/mysql-test/r/pbxt_snapshot.result (+76/-0)
test/mysql-test/t/pbxt_snapshot-master.opt (+2/-0)
test/mysql-test/t/pbxt_snapshot.test (+104/-0)
To merge this branch: bzr merge lp:~vkolesnikov/pbxt/pbxt-bug-499026
Reviewer Review Type Date Requested Status
PBXT Core Pending
Review via email: mp+16448@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2009-12-18 11:12:37 +0000
+++ ChangeLog 2009-12-21 21:17:12 +0000
@@ -3,6 +3,8 @@
33
4------- 1.0.10 RC4 - 2009-12-184------- 1.0.10 RC4 - 2009-12-18
55
6RN296: Fixed bug #499026: START TRANSACTION WITH CONSISTENT SNAPSHOT does not work for PBXT
7
6RN295: PBXT tests now all run with MySQL 5.1.41.8RN295: PBXT tests now all run with MySQL 5.1.41.
79
8RN294: Fixed bug #483714: a broken table can prevent other tables from opening10RN294: Fixed bug #483714: a broken table can prevent other tables from opening
911
=== modified file 'src/ha_pbxt.cc'
--- src/ha_pbxt.cc 2009-12-07 11:15:02 +0000
+++ src/ha_pbxt.cc 2009-12-21 21:17:12 +0000
@@ -113,6 +113,7 @@
113static int pbxt_recover(handlerton *hton, XID *xid_list, uint len);113static int pbxt_recover(handlerton *hton, XID *xid_list, uint len);
114static int pbxt_commit_by_xid(handlerton *hton, XID *xid);114static int pbxt_commit_by_xid(handlerton *hton, XID *xid);
115static int pbxt_rollback_by_xid(handlerton *hton, XID *xid);115static int pbxt_rollback_by_xid(handlerton *hton, XID *xid);
116static int pbxt_start_consistent_snapshot(handlerton *hton, THD *thd);
116#endif117#endif
117static void ha_aquire_exclusive_use(XTThreadPtr self, XTSharePtr share, ha_pbxt *mine);118static void ha_aquire_exclusive_use(XTThreadPtr self, XTSharePtr share, ha_pbxt *mine);
118static void ha_release_exclusive_use(XTThreadPtr self, XTSharePtr share);119static void ha_release_exclusive_use(XTThreadPtr self, XTSharePtr share);
@@ -1146,6 +1147,7 @@
1146 pbxt_hton->show_status = pbxt_show_status;1147 pbxt_hton->show_status = pbxt_show_status;
1147 pbxt_hton->flags = HTON_NO_FLAGS; /* HTON_CAN_RECREATE - Without this flags TRUNCATE uses delete_all_rows() */1148 pbxt_hton->flags = HTON_NO_FLAGS; /* HTON_CAN_RECREATE - Without this flags TRUNCATE uses delete_all_rows() */
1148 pbxt_hton->slot = (uint)-1; /* assign invald value, so we know when it's inited later */1149 pbxt_hton->slot = (uint)-1; /* assign invald value, so we know when it's inited later */
1150 pbxt_hton->start_consistent_snapshot = pbxt_start_consistent_snapshot;
1149#if defined(MYSQL_SUPPORTS_BACKUP) && defined(XT_ENABLE_ONLINE_BACKUP)1151#if defined(MYSQL_SUPPORTS_BACKUP) && defined(XT_ENABLE_ONLINE_BACKUP)
1150 pbxt_hton->get_backup_engine = pbxt_backup_engine;1152 pbxt_hton->get_backup_engine = pbxt_backup_engine;
1151#endif1153#endif
@@ -1424,6 +1426,28 @@
1424 * internally.1426 * internally.
1425 */1427 */
14261428
1429static int pbxt_start_consistent_snapshot(handlerton *hton, THD *thd)
1430{
1431 int err = 0;
1432 XTThreadPtr self = ha_set_current_thread(thd, &err);
1433
1434 if (!self->st_database && pbxt_database) {
1435 xt_ha_open_database_of_table(self, (XTPathStrPtr) NULL);
1436 }
1437
1438 if (xt_xn_begin(self)) {
1439 trans_register_ha(thd, TRUE, hton);
1440 } else {
1441 err = xt_ha_pbxt_thread_error_for_mysql(thd, self, FALSE);
1442 }
1443
1444 /*
1445 * As of MySQL 5.1.41 the return value is not checked, so the server might assume
1446 * everything is fine even it isn't. InnoDB returns 0 on success.
1447 */
1448 return err;
1449}
1450
1427/*1451/*
1428 * Commit the PBXT transaction of the given thread.1452 * Commit the PBXT transaction of the given thread.
1429 * thd is the MySQL thread structure.1453 * thd is the MySQL thread structure.
14301454
=== modified file 'test/mysql-test/pbxt-test-run.pl'
--- test/mysql-test/pbxt-test-run.pl 2009-12-16 21:54:25 +0000
+++ test/mysql-test/pbxt-test-run.pl 2009-12-21 21:17:12 +0000
@@ -2482,7 +2482,9 @@
2482 # on windows, copy all files from std_data into var/std_data_ln2482 # on windows, copy all files from std_data into var/std_data_ln
2483 mkpath("$opt_vardir/std_data_ln");2483 mkpath("$opt_vardir/std_data_ln");
2484 mtr_copy_dir("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data_ln");2484 mtr_copy_dir("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data_ln");
2485 }2485 mkpath("$opt_vardir/std_data");
2486 mtr_copy_dir("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data");
2487}
24862488
2487 # Remove old log files2489 # Remove old log files
2488 foreach my $name (glob("r/*.progress r/*.log r/*.warnings"))2490 foreach my $name (glob("r/*.progress r/*.log r/*.warnings"))
24892491
=== added file 'test/mysql-test/r/pbxt_snapshot.result'
--- test/mysql-test/r/pbxt_snapshot.result 1970-01-01 00:00:00 +0000
+++ test/mysql-test/r/pbxt_snapshot.result 2009-12-21 21:17:12 +0000
@@ -0,0 +1,76 @@
1CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
2CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=pbxt;
3SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
4BEGIN;
5SELECT * FROM t1;
6a
7BEGIN;
8INSERT INTO t1 VALUES (1);
9COMMIT;
10BEGIN;
11INSERT INTO t2 VALUES (1);
12COMMIT;
13SELECT * FROM t1;
14a
15SELECT * FROM t2;
16a
171
18COMMIT;
19SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
20START TRANSACTION WITH CONSISTENT SNAPSHOT;
21SELECT * FROM t1;
22a
231
24BEGIN;
25INSERT INTO t1 VALUES (2);
26COMMIT;
27BEGIN;
28INSERT INTO t2 VALUES (2);
29COMMIT;
30SELECT * FROM t1;
31a
321
33SELECT * FROM t2;
34a
351
36COMMIT;
37DROP TABLE t1;
38DROP TABLE t2;
39CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=pbxt;
40CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=innodb;
41SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
42BEGIN;
43SELECT * FROM t1;
44a
45BEGIN;
46INSERT INTO t1 VALUES (1);
47COMMIT;
48BEGIN;
49INSERT INTO t2 VALUES (1);
50COMMIT;
51SELECT * FROM t1;
52a
53SELECT * FROM t2;
54a
551
56COMMIT;
57SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
58START TRANSACTION WITH CONSISTENT SNAPSHOT;
59SELECT * FROM t1;
60a
611
62BEGIN;
63INSERT INTO t1 VALUES (2);
64COMMIT;
65BEGIN;
66INSERT INTO t2 VALUES (2);
67COMMIT;
68SELECT * FROM t1;
69a
701
71SELECT * FROM t2;
72a
731
74COMMIT;
75DROP TABLE t1;
76DROP TABLE t2;
077
=== added file 'test/mysql-test/t/pbxt_snapshot-master.opt'
--- test/mysql-test/t/pbxt_snapshot-master.opt 1970-01-01 00:00:00 +0000
+++ test/mysql-test/t/pbxt_snapshot-master.opt 2009-12-21 21:17:12 +0000
@@ -0,0 +1,2 @@
1--loose-innodb
2--pbxt-support-xa=0
03
=== added file 'test/mysql-test/t/pbxt_snapshot.test'
--- test/mysql-test/t/pbxt_snapshot.test 1970-01-01 00:00:00 +0000
+++ test/mysql-test/t/pbxt_snapshot.test 2009-12-21 21:17:12 +0000
@@ -0,0 +1,104 @@
1# --source include/have_pbxt.inc
2# --source include/have_innodb.inc
3
4CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
5CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=pbxt;
6
7connect(con1,localhost,root,,);
8connect(con2,localhost,root,,);
9
10connection default;
11SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
12BEGIN;
13SELECT * FROM t1;
14
15connection con1;
16BEGIN;
17INSERT INTO t1 VALUES (1);
18COMMIT;
19
20connection con2;
21BEGIN;
22INSERT INTO t2 VALUES (1);
23COMMIT;
24
25connection default;
26SELECT * FROM t1;
27SELECT * FROM t2;
28COMMIT;
29
30# Now try again with START TRANSACTION WITH CONSISTENT SNAPSHOT.
31connection default;
32SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
33START TRANSACTION WITH CONSISTENT SNAPSHOT;
34SELECT * FROM t1;
35
36connection con1;
37BEGIN;
38INSERT INTO t1 VALUES (2);
39COMMIT;
40
41connection con2;
42BEGIN;
43INSERT INTO t2 VALUES (2);
44COMMIT;
45
46connection default;
47SELECT * FROM t1;
48SELECT * FROM t2;
49COMMIT;
50
51DROP TABLE t1;
52DROP TABLE t2;
53
54# Try again with table types reversed.
55CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=pbxt;
56CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=innodb;
57
58connection default;
59SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
60BEGIN;
61SELECT * FROM t1;
62
63connection con1;
64BEGIN;
65INSERT INTO t1 VALUES (1);
66COMMIT;
67
68connection con2;
69BEGIN;
70INSERT INTO t2 VALUES (1);
71COMMIT;
72
73connection default;
74SELECT * FROM t1;
75SELECT * FROM t2;
76COMMIT;
77
78# Now try again with START TRANSACTION WITH CONSISTENT SNAPSHOT.
79connection default;
80SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
81START TRANSACTION WITH CONSISTENT SNAPSHOT;
82SELECT * FROM t1;
83
84connection con1;
85BEGIN;
86INSERT INTO t1 VALUES (2);
87COMMIT;
88
89connection con2;
90BEGIN;
91INSERT INTO t2 VALUES (2);
92COMMIT;
93
94connection default;
95SELECT * FROM t1;
96SELECT * FROM t2;
97COMMIT;
98
99DROP TABLE t1;
100DROP TABLE t2;
101
102--disable_query_log
103drop database pbxt;
104--enable_query_log

Subscribers

People subscribed via source and target branches