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

Proposed by Vladimir Kolesnikov
Status: Merged
Merge reported by: Paul McCullagh
Merged at revision: not available
Proposed branch: lp:~vkolesnikov/pbxt/pbxt-bug-368692
Merge into: lp:pbxt
Diff against target: None lines
To merge this branch: bzr merge lp:~vkolesnikov/pbxt/pbxt-bug-368692
Reviewer Review Type Date Requested Status
PBXT Core Pending
Review via email: mp+8123@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
1=== modified file 'ChangeLog'
2--- ChangeLog 2009-06-30 15:58:15 +0000
3+++ ChangeLog 2009-07-02 12:13:58 +0000
4@@ -3,6 +3,8 @@
5
6 ------- 1.0.08 RC2 - 2009-06-30
7
8+RN252: Fixed bug #368692: PBXT not reporting data size correctly in information_schema
9+
10 RN251: A Windows-specific test update, also removed false assertion that failed on Windows.
11
12 RN250: Fixed a bug that caused recovery to fail when the transaction log ID exceeded 255. The problem was a checksum failed in the log record.
13
14=== modified file 'src/ha_pbxt.cc'
15--- src/ha_pbxt.cc 2009-06-23 16:07:06 +0000
16+++ src/ha_pbxt.cc 2009-07-02 12:13:58 +0000
17@@ -3478,7 +3478,7 @@
18 if (flag & HA_STATUS_VARIABLE) {
19 stats.deleted = ot->ot_table->tab_row_fnum;
20 stats.records = (ha_rows) (ot->ot_table->tab_row_eof_id - 1 - stats.deleted);
21- stats.data_file_length = ot->ot_table->tab_rec_eof_id;
22+ stats.data_file_length = xt_rec_id_to_rec_offset(ot->ot_table, ot->ot_table->tab_rec_eof_id);
23 stats.index_file_length = xt_ind_node_to_offset(ot->ot_table, ot->ot_table->tab_ind_eof);
24 stats.delete_length = ot->ot_table->tab_rec_fnum * ot->ot_rec_size;
25 //check_time = info.check_time;
26
27=== modified file 'src/table_xt.cc'
28--- src/table_xt.cc 2009-06-30 08:41:57 +0000
29+++ src/table_xt.cc 2009-07-02 12:13:58 +0000
30@@ -1764,6 +1764,7 @@
31 u_llong max_comp_rec_len = 0;
32 size_t rec_size;
33 size_t row_size;
34+ u_llong ext_data_len = 0;
35
36 #if defined(DUMP_CHECK_TABLE) || defined(CHECK_TABLE_STATS)
37 printf("\nCHECK TABLE: %s\n", tab->tab_name->ps_path);
38@@ -1863,6 +1864,7 @@
39 printf("record-X ");
40 #endif
41 alloc_rec_count++;
42+ ext_data_len += XT_GET_DISK_4(rec_buf->re_log_dat_siz_4);
43 row_size = XT_GET_DISK_4(rec_buf->re_log_dat_siz_4) + ot->ot_rec_size - XT_REC_EXT_HEADER_SIZE;
44 alloc_rec_bytes += row_size;
45 if (!min_comp_rec_len || row_size < min_comp_rec_len)
46@@ -1918,6 +1920,9 @@
47 }
48
49 #ifdef CHECK_TABLE_STATS
50+ if (!tab->tab_dic.dic_rec_fixed)
51+ printf("Extendend data length = %llu\n", ext_data_len);
52+
53 if (alloc_rec_count) {
54 printf("Minumum comp. rec. len. = %llu\n", (u_llong) min_comp_rec_len);
55 printf("Average comp. rec. len. = %llu\n", (u_llong) ((double) alloc_rec_bytes / (double) alloc_rec_count + (double) 0.5));
56
57=== modified file 'test/mysql-test/r/pbxt_bugs.result'
58--- test/mysql-test/r/pbxt_bugs.result 2009-06-12 15:27:28 +0000
59+++ test/mysql-test/r/pbxt_bugs.result 2009-07-02 12:13:58 +0000
60@@ -1274,3 +1274,35 @@
61 c1
62 1
63 DROP TABLE t1;
64+create table t1 (c1 int, c2 int, c3 int) engine = pbxt;
65+insert into t1 values (1,2,3);
66+insert into t1 select * from t1;
67+insert into t1 select * from t1;
68+insert into t1 select * from t1;
69+insert into t1 select * from t1;
70+SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
71+DATA_LENGTH INDEX_LENGTH
72+1456 4096
73+alter table t1 add index (c1);
74+alter table t1 add index (c2);
75+alter table t1 add index (c3);
76+SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
77+DATA_LENGTH INDEX_LENGTH
78+1456 53248
79+drop table t1;
80+create table t1 (c1 int, c2 int, c3 int, c4 varchar(255), c5 varchar(255)) engine = pbxt;
81+insert into t1 values (1,2,3, repeat('a', 255), repeat('b', 255));
82+insert into t1 select * from t1;
83+insert into t1 select * from t1;
84+insert into t1 select * from t1;
85+insert into t1 select * from t1;
86+SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
87+DATA_LENGTH INDEX_LENGTH
88+5120 4096
89+alter table t1 add index (c1);
90+alter table t1 add index (c2);
91+alter table t1 add index (c3);
92+SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
93+DATA_LENGTH INDEX_LENGTH
94+5120 53248
95+drop table t1;
96
97=== modified file 'test/mysql-test/t/pbxt_bugs.test'
98--- test/mysql-test/t/pbxt_bugs.test 2009-06-12 15:27:28 +0000
99+++ test/mysql-test/t/pbxt_bugs.test 2009-07-02 12:13:58 +0000
100@@ -977,6 +977,34 @@
101 SELECT * FROM t1;
102 DROP TABLE t1;
103
104+# bug 368692: PBXT not reporting data size correctly in information_schema
105+
106+create table t1 (c1 int, c2 int, c3 int) engine = pbxt;
107+insert into t1 values (1,2,3);
108+insert into t1 select * from t1;
109+insert into t1 select * from t1;
110+insert into t1 select * from t1;
111+insert into t1 select * from t1;
112+SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
113+alter table t1 add index (c1);
114+alter table t1 add index (c2);
115+alter table t1 add index (c3);
116+SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
117+drop table t1;
118+# for variable size records, only the fixed part size is currently reported, the rest can be seen in server console after running CHECK TABLE
119+create table t1 (c1 int, c2 int, c3 int, c4 varchar(255), c5 varchar(255)) engine = pbxt;
120+insert into t1 values (1,2,3, repeat('a', 255), repeat('b', 255));
121+insert into t1 select * from t1;
122+insert into t1 select * from t1;
123+insert into t1 select * from t1;
124+insert into t1 select * from t1;
125+SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
126+alter table t1 add index (c1);
127+alter table t1 add index (c2);
128+alter table t1 add index (c3);
129+SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
130+drop table t1;
131+
132 --disable_query_log
133
134 DROP TABLE t2, t5;

Subscribers

People subscribed via source and target branches