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

Proposed by Vladimir Kolesnikov
Status: Merged
Merged at revision: not available
Proposed branch: lp:~vkolesnikov/pbxt/pbxt-bug-483714
Merge into: lp:pbxt
Diff against target: 238 lines (+58/-19)
11 files modified
ChangeLog (+10/-0)
src/discover_xt.cc (+2/-2)
src/table_xt.cc (+12/-4)
test/mysql-test/r/binlog_stm_ctype_ucs.result (+2/-3)
test/mysql-test/r/ctype_cp932_binlog_stm.result (+6/-6)
test/mysql-test/r/ctype_recoding.result (+1/-1)
test/mysql-test/r/partition.result (+1/-1)
test/mysql-test/r/pbxt_bugs.result (+9/-0)
test/mysql-test/r/pbxt_ref_int.result (+1/-1)
test/mysql-test/t/pbxt_bugs.test (+12/-0)
test/mysql-test/t/pbxt_ref_int.test (+2/-1)
To merge this branch: bzr merge lp:~vkolesnikov/pbxt/pbxt-bug-483714
Reviewer Review Type Date Requested Status
Vladimir Kolesnikov (community) Needs Resubmitting
Paul McCullagh Needs Fixing
Review via email: mp+16186@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

Hi Vlad,

We need to log the errors that are being ignored here.

xt_log_and_clear_warning() logs the errors as a warning.

review: Needs Fixing
lp:~vkolesnikov/pbxt/pbxt-bug-483714 updated
748. By Vladimir Kolesnikov

update to the bugfix

Revision history for this message
Vladimir Kolesnikov (vkolesnikov) wrote :

> Hi Vlad,
>
> We need to log the errors that are being ignored here.
>
> xt_log_and_clear_warning() logs the errors as a warning.

done

Revision history for this message
Vladimir Kolesnikov (vkolesnikov) :
review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2009-12-10 12:16:56 +0000
3+++ ChangeLog 2009-12-16 10:37:11 +0000
4@@ -1,6 +1,7 @@
5 PBXT Release Notes
6 ==================
7
8+<<<<<<< TREE
9 ------- 1.0.10 RC4 - Not released yet
10
11 RN293: Added system variable pbxt_flush_log_at_trx_commit. The value of this variable determines whether the transaction log is written and/or flushed when a transaction is ended. A value of 0 means don't write or flush the transaction log, 1 means write and flush and 2 means write, but do not flush. No matter what the setting is choosen, the transaction log is written and flushed at least once per second.
12@@ -12,6 +13,15 @@
13 ------- 1.0.09f RC3 - 2009-11-30
14
15 RN291: Fixed bug #489088: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown.
16+=======
17+------- 1.0.09g RC3 - not yet released
18+
19+RN291: Fixed bug #483714: a broken table can prevent other tables from opening
20+
21+RN290: Fixed bug #489088: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown
22+
23+------- 1.0.09f RC3 - 2009-11-25
24+>>>>>>> MERGE-SOURCE
25
26 RN290: Fixed bug #345524: pbxt does not compile on 64 bit windows. Currently atomic operations are not supported on this platform.
27
28
29=== modified file 'src/discover_xt.cc'
30--- src/discover_xt.cc 2009-11-24 08:50:16 +0000
31+++ src/discover_xt.cc 2009-12-16 10:37:11 +0000
32@@ -355,10 +355,10 @@
33 {
34 if (!(b_flags & HA_NOSAME))
35 return -1;
36- if ((a_flags ^ b_flags) & (HA_NULL_PART_KEY | HA_END_SPACE_KEY))
37+ if ((a_flags ^ b_flags) & HA_NULL_PART_KEY)
38 {
39 /* Sort NOT NULL keys before other keys */
40- return (a_flags & (HA_NULL_PART_KEY | HA_END_SPACE_KEY)) ? 1 : -1;
41+ return (a_flags & HA_NULL_PART_KEY) ? 1 : -1;
42 }
43 if (a->name == primary_key_name)
44 return -1;
45
46=== modified file 'src/table_xt.cc'
47--- src/table_xt.cc 2009-11-25 15:45:25 +0000
48+++ src/table_xt.cc 2009-12-16 10:37:11 +0000
49@@ -505,7 +505,12 @@
50 xt_strcpy(PATH_MAX, pbuf, te_ptr->te_tab_path->tp_path);
51 xt_add_dir_char(PATH_MAX, pbuf);
52 xt_strcat(PATH_MAX, pbuf, te_ptr->te_tab_name);
53- xt_heap_release(self, xt_use_table_no_lock(self, db, (XTPathStrPtr)pbuf, FALSE, FALSE, NULL, NULL));
54+ try_(a) {
55+ xt_heap_release(self, xt_use_table_no_lock(self, db, (XTPathStrPtr)pbuf, FALSE, FALSE, NULL, NULL));
56+ } catch_(a) {
57+ /* ignore errors */
58+ xt_log_and_clear_warning(self);
59+ } cont_(a);
60 }
61
62 popr_(); // Discard xt_tab_exit_db(db)
63@@ -1148,9 +1153,12 @@
64 * will work if we have cyclic foreign key references.
65 */
66 if (tab->tab_dic.dic_table) {
67- pushr_(xt_del_from_db_tables_ht, tab);
68- tab->tab_dic.dic_table->attachReferences(self, db);
69- popr_();
70+ try_(a) {
71+ tab->tab_dic.dic_table->attachReferences(self, db);
72+ } catch_(a) {
73+ /* ignore problems of referenced tables */
74+ xt_log_and_clear_warning(self);
75+ } cont_(a);
76 }
77
78 *r_tab = tab;
79
80=== modified file 'test/mysql-test/r/binlog_stm_ctype_ucs.result'
81--- test/mysql-test/r/binlog_stm_ctype_ucs.result 2009-11-10 18:20:34 +0000
82+++ test/mysql-test/r/binlog_stm_ctype_ucs.result 2009-12-16 10:37:11 +0000
83@@ -5,16 +5,15 @@
84 insert into t2 values (@v);
85 show binlog events from 106;
86 Log_name Pos Event_type Server_id End_log_pos Info
87-master-bin.000001 106 Query 1 174 use `test`; BEGIN
88+master-bin.000001 106 Query 1 174 BEGIN
89 master-bin.000001 174 Table_map 1 217 table_id: # (test.t2)
90 master-bin.000001 217 Write_rows 1 307 table_id: # flags: STMT_END_F
91-master-bin.000001 307 Query 1 376 use `test`; COMMIT
92+master-bin.000001 307 Query 1 376 COMMIT
93 flush logs;
94 /*!40019 SET @@session.max_insert_delayed_threads=0*/;
95 /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
96 DELIMITER /*!*/;
97 ROLLBACK/*!*/;
98-use test/*!*/;
99 SET TIMESTAMP=10000/*!*/;
100 SET @@session.pseudo_thread_id=999999999/*!*/;
101 SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
102
103=== modified file 'test/mysql-test/r/ctype_cp932_binlog_stm.result'
104--- test/mysql-test/r/ctype_cp932_binlog_stm.result 2008-11-05 15:56:49 +0000
105+++ test/mysql-test/r/ctype_cp932_binlog_stm.result 2009-12-16 10:37:11 +0000
106@@ -9,10 +9,10 @@
107 SHOW BINLOG EVENTS FROM 106;
108 Log_name Pos Event_type Server_id End_log_pos Info
109 master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(f1 blob)
110-master-bin.000001 # Query 1 # use `test`; BEGIN
111+master-bin.000001 # Query 1 # BEGIN
112 master-bin.000001 # Table_map 1 # table_id: # (test.t1)
113 master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
114-master-bin.000001 # Query 1 # use `test`; COMMIT
115+master-bin.000001 # Query 1 # COMMIT
116 SELECT HEX(f1) FROM t1;
117 HEX(f1)
118 8300
119@@ -35,10 +35,10 @@
120 SHOW BINLOG EVENTS FROM 106|
121 Log_name Pos Event_type Server_id End_log_pos Info
122 master-bin.000001 106 Query 1 196 use `test`; CREATE TABLE t1(f1 blob)
123-master-bin.000001 196 Query 1 267 use `test`; BEGIN
124+master-bin.000001 196 Query 1 267 BEGIN
125 master-bin.000001 267 Table_map 1 309 table_id: 16 (test.t1)
126 master-bin.000001 309 Write_rows 1 343 table_id: 16 flags: STMT_END_F
127-master-bin.000001 343 Query 1 415 use `test`; COMMIT
128+master-bin.000001 343 Query 1 415 COMMIT
129 master-bin.000001 415 Query 1 494 use `test`; DROP table t1
130 master-bin.000001 494 Query 1 660 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
131 s2 CHAR(50) CHARACTER SET cp932,
132@@ -49,9 +49,9 @@
133 BEGIN
134 INSERT INTO t4 VALUES (ins1, ins2, ind);
135 END
136-master-bin.000001 909 Query 1 977 use `test`; BEGIN
137+master-bin.000001 909 Query 1 977 BEGIN
138 master-bin.000001 977 Table_map 1 1026 table_id: 18 (test.t4)
139 master-bin.000001 1026 Write_rows 1 1080 table_id: 18 flags: STMT_END_F
140-master-bin.000001 1080 Query 1 1149 use `test`; COMMIT
141+master-bin.000001 1080 Query 1 1149 COMMIT
142 master-bin.000001 1149 Query 1 1238 use `test`; DROP PROCEDURE bug18293
143 master-bin.000001 1238 Query 1 1317 use `test`; DROP TABLE t4
144
145=== modified file 'test/mysql-test/r/ctype_recoding.result'
146--- test/mysql-test/r/ctype_recoding.result 2008-03-11 16:31:13 +0000
147+++ test/mysql-test/r/ctype_recoding.result 2009-12-16 10:37:11 +0000
148@@ -165,7 +165,7 @@
149 ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ'
150 SET NAMES utf8;
151 CREATE TABLE `goodÐÌÏÈÏ` (a int);
152-ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ` (a int)'
153+ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ'
154 set names latin1;
155 create table t1 (a char(10) character set koi8r, b text character set koi8r);
156 insert into t1 values ('test','test');
157
158=== modified file 'test/mysql-test/r/partition.result'
159--- test/mysql-test/r/partition.result 2009-06-02 19:05:33 +0000
160+++ test/mysql-test/r/partition.result 2009-12-16 10:37:11 +0000
161@@ -751,7 +751,7 @@
162 subpartition by hash(a)
163 (partition p0 values less than (0),
164 partition p1 values less than (1) (subpartition sp0));
165-ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '))' at line 5
166+ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near 'subpartition sp0))' at line 5
167 create table t1 (a int)
168 partition by hash (a)
169 (partition p0 (subpartition sp0));
170
171=== modified file 'test/mysql-test/r/pbxt_bugs.result'
172--- test/mysql-test/r/pbxt_bugs.result 2009-07-22 08:31:39 +0000
173+++ test/mysql-test/r/pbxt_bugs.result 2009-12-16 10:37:11 +0000
174@@ -1316,3 +1316,12 @@
175 insert into t2 values (1,3);
176 ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (Constraint: `fk1`)
177 drop table t2, t1;
178+create table t2 (id int primary key, constraint foreign key fk1 (id) references t1(id)) engine=pbxt;
179+select * from t2;
180+id
181+insert into t2 values (1);
182+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (Referenced table `t1` not found)
183+create table t1 (id int primary key) engine=pbxt;
184+insert into t1 values (1);
185+insert into t2 values (1);
186+drop table t2, t1;
187
188=== modified file 'test/mysql-test/r/pbxt_ref_int.result'
189--- test/mysql-test/r/pbxt_ref_int.result 2009-06-30 11:05:34 +0000
190+++ test/mysql-test/r/pbxt_ref_int.result 2009-12-16 10:37:11 +0000
191@@ -365,7 +365,7 @@
192 drop table if exists t2, t1;
193 set foreign_key_checks = 1;
194 CREATE TABLE t2 (s1 INT DEFAULT NULL, FOREIGN KEY (s1) REFERENCES t1 (s1));
195-ERROR HY000: Can't create table 'test.t2' (errno: 151)
196+drop table if exists t2;
197 set foreign_key_checks = 0;
198 CREATE TABLE t2 (s1 INT DEFAULT NULL, FOREIGN KEY (s1) REFERENCES t1 (s1));
199 set foreign_key_checks = 1;
200
201=== modified file 'test/mysql-test/t/pbxt_bugs.test'
202--- test/mysql-test/t/pbxt_bugs.test 2009-07-22 08:31:39 +0000
203+++ test/mysql-test/t/pbxt_bugs.test 2009-12-16 10:37:11 +0000
204@@ -1023,6 +1023,18 @@
205
206 drop table t2, t1;
207
208+# bug 483714: a broken table can prevent other tables from opening
209+
210+create table t2 (id int primary key, constraint foreign key fk1 (id) references t1(id)) engine=pbxt;
211+select * from t2;
212+--error 1452
213+insert into t2 values (1);
214+create table t1 (id int primary key) engine=pbxt;
215+insert into t1 values (1);
216+insert into t2 values (1);
217+
218+drop table t2, t1;
219+
220 --disable_query_log
221
222 DROP TABLE t5;
223
224=== modified file 'test/mysql-test/t/pbxt_ref_int.test'
225--- test/mysql-test/t/pbxt_ref_int.test 2009-04-02 20:28:52 +0000
226+++ test/mysql-test/t/pbxt_ref_int.test 2009-12-16 10:37:11 +0000
227@@ -325,9 +325,10 @@
228 drop table if exists t2, t1;
229 --enable_warnings
230
231+# PBXT doesn't depend on foreign_key_checks setting
232 set foreign_key_checks = 1;
233---error 1005
234 CREATE TABLE t2 (s1 INT DEFAULT NULL, FOREIGN KEY (s1) REFERENCES t1 (s1));
235+drop table if exists t2;
236
237 set foreign_key_checks = 0;
238 CREATE TABLE t2 (s1 INT DEFAULT NULL, FOREIGN KEY (s1) REFERENCES t1 (s1));

Subscribers

People subscribed via source and target branches