Merge lp:~vkolesnikov/pbxt/pbxt-mem-debugger-and-leaks into lp:pbxt
- pbxt-mem-debugger-and-leaks
- Merge into trunk
Proposed by
Vladimir Kolesnikov
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~vkolesnikov/pbxt/pbxt-mem-debugger-and-leaks |
Merge into: | lp:pbxt |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~vkolesnikov/pbxt/pbxt-mem-debugger-and-leaks |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PBXT Core | Pending | ||
Review via email: mp+4378@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Paul McCullagh (paul-mccullagh) wrote : | # |
Revision history for this message
Vladimir Kolesnikov (vkolesnikov) wrote : | # |
Hi Paul,
please ignore the change to src/datadic_xt.cc. I think I made it prior to making the real fix (in the ha_pbxt.cc) and then forgot to recheck it. I just retested it and no leaks are reported w/o that line.
- 582. By Vladimir Kolesnikov
-
merge from upstream
- 583. By Vladimir Kolesnikov
-
removed unneeded change
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'ChangeLog' | |||
2 | --- ChangeLog 2009-03-05 15:28:42 +0000 | |||
3 | +++ ChangeLog 2009-03-10 17:43:39 +0000 | |||
4 | @@ -3,6 +3,10 @@ | |||
5 | 3 | 3 | ||
6 | 4 | ------- 1.0.08 RC - Not yet released | 4 | ------- 1.0.08 RC - Not yet released |
7 | 5 | 5 | ||
8 | 6 | RN226: Fixed bug #340316: Issue with bigint unsigned auto-increment field | ||
9 | 7 | |||
10 | 8 | RN225: Fixed bug #308557: UPDATE fails to match all rows in a transactional scenario | ||
11 | 9 | |||
12 | 6 | RN224: Fixed a deadlock which could occur during table scans. | 10 | RN224: Fixed a deadlock which could occur during table scans. |
13 | 7 | 11 | ||
14 | 8 | RN223: Index scans now use handles to cache buffers instead of making a copy of the index page. The handles are "copy-on-write". | 12 | RN223: Index scans now use handles to cache buffers instead of making a copy of the index page. The handles are "copy-on-write". |
15 | 9 | 13 | ||
16 | === modified file 'src/datadic_xt.cc' | |||
17 | --- src/datadic_xt.cc 2009-01-21 13:55:57 +0000 | |||
18 | +++ src/datadic_xt.cc 2009-03-11 15:38:29 +0000 | |||
19 | @@ -1513,6 +1513,7 @@ | |||
20 | 1513 | for (i=0; i<ct_curr_table->dt_fkeys.size(); i++) { | 1513 | for (i=0; i<ct_curr_table->dt_fkeys.size(); i++) { |
21 | 1514 | fkey = ct_curr_table->dt_fkeys.itemAt(i); | 1514 | fkey = ct_curr_table->dt_fkeys.itemAt(i); |
22 | 1515 | if (fkey->co_name && myxt_strcasecmp(con_name, fkey->co_name) == 0) { | 1515 | if (fkey->co_name && myxt_strcasecmp(con_name, fkey->co_name) == 0) { |
23 | 1516 | xt_free(self, fkey->co_name); | ||
24 | 1516 | ct_curr_table->dt_fkeys.remove(fkey); | 1517 | ct_curr_table->dt_fkeys.remove(fkey); |
25 | 1517 | fkey->release(self); | 1518 | fkey->release(self); |
26 | 1518 | } | 1519 | } |
27 | 1519 | 1520 | ||
28 | === modified file 'src/ha_pbxt.cc' | |||
29 | --- src/ha_pbxt.cc 2009-02-27 09:22:44 +0000 | |||
30 | +++ src/ha_pbxt.cc 2009-03-11 15:38:29 +0000 | |||
31 | @@ -2065,7 +2065,7 @@ | |||
32 | 2065 | MX_ULONGLONG_T *nb_reserved_values __attribute__((unused))) | 2065 | MX_ULONGLONG_T *nb_reserved_values __attribute__((unused))) |
33 | 2066 | { | 2066 | { |
34 | 2067 | register XTTableHPtr tab; | 2067 | register XTTableHPtr tab; |
36 | 2068 | MX_ULONGLONG_T nr; | 2068 | MX_ULONGLONG_T nr, nr_plus_inc; |
37 | 2069 | 2069 | ||
38 | 2070 | ASSERT_NS(pb_ex_in_use); | 2070 | ASSERT_NS(pb_ex_in_use); |
39 | 2071 | 2071 | ||
40 | @@ -2077,7 +2077,11 @@ | |||
41 | 2077 | nr = offset; | 2077 | nr = offset; |
42 | 2078 | else if (increment > 1 && ((nr - offset) % increment) != 0) | 2078 | else if (increment > 1 && ((nr - offset) % increment) != 0) |
43 | 2079 | nr += increment - ((nr - offset) % increment); | 2079 | nr += increment - ((nr - offset) % increment); |
45 | 2080 | tab->tab_auto_inc = (xtWord8) (nr + increment); | 2080 | nr_plus_inc = nr + increment; |
46 | 2081 | if (table->next_number_field->cmp((const unsigned char *)&nr, (const unsigned char *)&nr_plus_inc) < 0) | ||
47 | 2082 | tab->tab_auto_inc = (xtWord8) (nr_plus_inc); | ||
48 | 2083 | else | ||
49 | 2084 | nr = ~0; /* indicate error to the caller */ | ||
50 | 2081 | xt_spinlock_unlock(&tab->tab_ainc_lock); | 2085 | xt_spinlock_unlock(&tab->tab_ainc_lock); |
51 | 2082 | 2086 | ||
52 | 2083 | *first_value = nr; | 2087 | *first_value = nr; |
53 | @@ -2091,25 +2095,34 @@ | |||
54 | 2091 | * insert into t1 values (-1); | 2095 | * insert into t1 values (-1); |
55 | 2092 | * insert into t1 values (NULL); | 2096 | * insert into t1 values (NULL); |
56 | 2093 | */ | 2097 | */ |
58 | 2094 | void ha_pbxt::set_auto_increment(MX_LONGLONG_T nr) | 2098 | void ha_pbxt::set_auto_increment(Field *nr) |
59 | 2095 | { | 2099 | { |
60 | 2096 | register XTTableHPtr tab; | 2100 | register XTTableHPtr tab; |
61 | 2101 | MX_ULONGLONG_T nr_int_val; | ||
62 | 2102 | |||
63 | 2103 | nr_int_val = nr->val_int(); | ||
64 | 2104 | tab = pb_open_tab->ot_table; | ||
65 | 2097 | 2105 | ||
68 | 2098 | tab = pb_open_tab->ot_table; | 2106 | if (nr->cmp((const unsigned char *)&tab->tab_auto_inc) > 0) { |
67 | 2099 | if ((MX_LONGLONG_T) tab->tab_auto_inc <= nr) { | ||
69 | 2100 | xt_spinlock_lock(&tab->tab_ainc_lock); | 2107 | xt_spinlock_lock(&tab->tab_ainc_lock); |
72 | 2101 | if ((MX_LONGLONG_T) tab->tab_auto_inc <= nr && nr > 0) | 2108 | |
73 | 2102 | tab->tab_auto_inc = nr + 1; | 2109 | if (nr->cmp((const unsigned char *)&tab->tab_auto_inc) > 0) { |
74 | 2110 | MX_ULONGLONG_T nr_int_val_plus_one = nr_int_val + 1; | ||
75 | 2111 | if (nr->cmp((const unsigned char *)&nr_int_val_plus_one) < 0) | ||
76 | 2112 | tab->tab_auto_inc = nr_int_val_plus_one; | ||
77 | 2113 | else | ||
78 | 2114 | tab->tab_auto_inc = nr_int_val; | ||
79 | 2115 | } | ||
80 | 2103 | xt_spinlock_unlock(&tab->tab_ainc_lock); | 2116 | xt_spinlock_unlock(&tab->tab_ainc_lock); |
81 | 2104 | } | 2117 | } |
82 | 2105 | 2118 | ||
83 | 2106 | if (xt_db_auto_increment_mode == 1) { | 2119 | if (xt_db_auto_increment_mode == 1) { |
85 | 2107 | if (nr > (MX_LONGLONG_T) tab->tab_dic.dic_min_auto_inc) { | 2120 | if (nr_int_val > (MX_ULONGLONG_T) tab->tab_dic.dic_min_auto_inc) { |
86 | 2108 | /* Do this every 100 calls: */ | 2121 | /* Do this every 100 calls: */ |
87 | 2109 | #ifdef DEBUG | 2122 | #ifdef DEBUG |
89 | 2110 | tab->tab_dic.dic_min_auto_inc = nr + 5; | 2123 | tab->tab_dic.dic_min_auto_inc = nr_int_val + 5; |
90 | 2111 | #else | 2124 | #else |
92 | 2112 | tab->tab_dic.dic_min_auto_inc = nr + 100; | 2125 | tab->tab_dic.dic_min_auto_inc = nr_int_val + 100; |
93 | 2113 | #endif | 2126 | #endif |
94 | 2114 | pb_open_tab->ot_thread = xt_get_self(); | 2127 | pb_open_tab->ot_thread = xt_get_self(); |
95 | 2115 | if (!xt_tab_write_min_auto_inc(pb_open_tab)) | 2128 | if (!xt_tab_write_min_auto_inc(pb_open_tab)) |
96 | @@ -2187,8 +2200,12 @@ | |||
97 | 2187 | table->timestamp_field->set_time(); | 2200 | table->timestamp_field->set_time(); |
98 | 2188 | 2201 | ||
99 | 2189 | if (table->next_number_field && buf == table->record[0]) { | 2202 | if (table->next_number_field && buf == table->record[0]) { |
102 | 2190 | update_auto_increment(); | 2203 | int err = update_auto_increment(); |
103 | 2191 | set_auto_increment(table->next_number_field->val_int()); | 2204 | if (err) { |
104 | 2205 | ha_log_pbxt_thread_error_for_mysql(pb_ignore_dup_key); | ||
105 | 2206 | return err; | ||
106 | 2207 | } | ||
107 | 2208 | set_auto_increment(table->next_number_field); | ||
108 | 2192 | } | 2209 | } |
109 | 2193 | 2210 | ||
110 | 2194 | if (!xt_tab_new_record(pb_open_tab, (xtWord1 *) buf)) | 2211 | if (!xt_tab_new_record(pb_open_tab, (xtWord1 *) buf)) |
111 | @@ -2281,8 +2298,8 @@ | |||
112 | 2281 | 2298 | ||
113 | 2282 | old_map = mx_tmp_use_all_columns(table, table->read_set); | 2299 | old_map = mx_tmp_use_all_columns(table, table->read_set); |
114 | 2283 | nr = table->found_next_number_field->val_int(); | 2300 | nr = table->found_next_number_field->val_int(); |
115 | 2301 | set_auto_increment(table->found_next_number_field); | ||
116 | 2284 | mx_tmp_restore_column_map(table, old_map); | 2302 | mx_tmp_restore_column_map(table, old_map); |
117 | 2285 | set_auto_increment(nr); | ||
118 | 2286 | } | 2303 | } |
119 | 2287 | 2304 | ||
120 | 2288 | if (!xt_tab_update_record(pb_open_tab, (xtWord1 *) old_data, (xtWord1 *) new_data)) | 2305 | if (!xt_tab_update_record(pb_open_tab, (xtWord1 *) old_data, (xtWord1 *) new_data)) |
121 | @@ -4788,6 +4805,8 @@ | |||
122 | 4788 | xt_create_table(self, (XTPathStrPtr) table_path, &dic); | 4805 | xt_create_table(self, (XTPathStrPtr) table_path, &dic); |
123 | 4789 | } | 4806 | } |
124 | 4790 | catch_(a) { | 4807 | catch_(a) { |
125 | 4808 | if (tab_def) | ||
126 | 4809 | tab_def->finalize(self); | ||
127 | 4791 | err = xt_ha_pbxt_thread_error_for_mysql(thd, self, pb_ignore_dup_key); | 4810 | err = xt_ha_pbxt_thread_error_for_mysql(thd, self, pb_ignore_dup_key); |
128 | 4792 | } | 4811 | } |
129 | 4793 | cont_(a); | 4812 | cont_(a); |
130 | 4794 | 4813 | ||
131 | === modified file 'src/ha_pbxt.h' | |||
132 | --- src/ha_pbxt.h 2008-12-10 20:34:30 +0000 | |||
133 | +++ src/ha_pbxt.h 2009-03-10 17:43:39 +0000 | |||
134 | @@ -171,7 +171,7 @@ | |||
135 | 171 | MX_ULONGLONG_T nb_desired_values, | 171 | MX_ULONGLONG_T nb_desired_values, |
136 | 172 | MX_ULONGLONG_T *first_value, | 172 | MX_ULONGLONG_T *first_value, |
137 | 173 | MX_ULONGLONG_T *nb_reserved_values); | 173 | MX_ULONGLONG_T *nb_reserved_values); |
139 | 174 | void set_auto_increment(MX_LONGLONG_T nr); | 174 | void set_auto_increment(Field *nr); |
140 | 175 | 175 | ||
141 | 176 | int write_row(byte * buf); | 176 | int write_row(byte * buf); |
142 | 177 | int update_row(const byte * old_data, byte * new_data); | 177 | int update_row(const byte * old_data, byte * new_data); |
143 | 178 | 178 | ||
144 | === modified file 'src/index_xt.cc' | |||
145 | --- src/index_xt.cc 2009-03-06 13:40:00 +0000 | |||
146 | +++ src/index_xt.cc 2009-03-10 08:28:54 +0000 | |||
147 | @@ -2327,7 +2327,9 @@ | |||
148 | 2327 | #endif | 2327 | #endif |
149 | 2328 | ASSERT_NS(ot->ot_ind_rhandle); | 2328 | ASSERT_NS(ot->ot_ind_rhandle); |
150 | 2329 | xt_ind_lock_handle(ot->ot_ind_rhandle); | 2329 | xt_ind_lock_handle(ot->ot_ind_rhandle); |
152 | 2330 | if (!ot->ot_ind_state.i_node_ref_size && ot->ot_ind_state.i_item_offset < ot->ot_ind_state.i_total_size) { | 2330 | if (!ot->ot_ind_state.i_node_ref_size && |
153 | 2331 | ot->ot_ind_state.i_item_offset < ot->ot_ind_state.i_total_size && | ||
154 | 2332 | ot->ot_ind_rhandle->ih_cache_reference) { | ||
155 | 2331 | key_value.sv_key = &ot->ot_ind_rhandle->ih_branch->tb_data[ot->ot_ind_state.i_item_offset]; | 2333 | key_value.sv_key = &ot->ot_ind_rhandle->ih_branch->tb_data[ot->ot_ind_state.i_item_offset]; |
156 | 2332 | key_value.sv_length = ot->ot_ind_state.i_item_size - XT_RECORD_REF_SIZE; | 2334 | key_value.sv_length = ot->ot_ind_state.i_item_size - XT_RECORD_REF_SIZE; |
157 | 2333 | 2335 | ||
158 | 2334 | 2336 | ||
159 | === modified file 'src/memory_xt.cc' | |||
160 | --- src/memory_xt.cc 2009-02-05 11:30:34 +0000 | |||
161 | +++ src/memory_xt.cc 2009-03-11 15:38:29 +0000 | |||
162 | @@ -376,7 +376,7 @@ | |||
163 | 376 | /* Not enough space, add more: */ | 376 | /* Not enough space, add more: */ |
164 | 377 | MissingMemoryRec *new_addresses; | 377 | MissingMemoryRec *new_addresses; |
165 | 378 | 378 | ||
167 | 379 | new_addresses = (MissingMemoryRec *) malloc(sizeof(MissingMemoryRec) * (mm_total_allocated + ADD_TOTAL_ALLOCS)); | 379 | new_addresses = (MissingMemoryRec *) xt_calloc_ns(sizeof(MissingMemoryRec) * (mm_total_allocated + ADD_TOTAL_ALLOCS)); |
168 | 380 | if (!new_addresses) | 380 | if (!new_addresses) |
169 | 381 | return(-1); | 381 | return(-1); |
170 | 382 | 382 | ||
171 | 383 | 383 | ||
172 | === modified file 'test/mysql-test/r/pbxt_bugs.result' | |||
173 | --- test/mysql-test/r/pbxt_bugs.result 2008-12-16 13:39:34 +0000 | |||
174 | +++ test/mysql-test/r/pbxt_bugs.result 2009-03-11 11:18:00 +0000 | |||
175 | @@ -986,3 +986,62 @@ | |||
176 | 986 | insert into t1 values ("1"); | 986 | insert into t1 values ("1"); |
177 | 987 | insert into t2 values ("1"); | 987 | insert into t2 values ("1"); |
178 | 988 | DROP TABLE IF EXISTS t2,t1; | 988 | DROP TABLE IF EXISTS t2,t1; |
179 | 989 | DROP TABLE IF EXISTS t5; | ||
180 | 990 | CREATE TABLE t5 ( | ||
181 | 991 | c1 BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, | ||
182 | 992 | c2 BIGINT SIGNED NULL, | ||
183 | 993 | c3 BIGINT SIGNED NOT NULL, | ||
184 | 994 | c4 TINYINT, c5 SMALLINT, | ||
185 | 995 | c6 MEDIUMINT, | ||
186 | 996 | c7 INT, | ||
187 | 997 | c8 INTEGER, | ||
188 | 998 | PRIMARY KEY(c1,c2), UNIQUE INDEX(c3)); | ||
189 | 999 | INSERT INTO t5 VALUES | ||
190 | 1000 | (0,-9223372036854775808,1,2,3,4,5,5), | ||
191 | 1001 | (255,-2147483648,6,7,8,9,10,10), | ||
192 | 1002 | (65535,-8388608,11,12,13,14,15,15), | ||
193 | 1003 | (16777215,-32768,16,17,18,19,20,20), | ||
194 | 1004 | (4294967295,-128,21,22,23,24,25,25), | ||
195 | 1005 | (18446744073709551615,9223372036854775807,26,27,28,29,30,30); | ||
196 | 1006 | INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */; | ||
197 | 1007 | ERROR HY000: Failed to read auto-increment value from storage engine | ||
198 | 1008 | INSERT INTO t5(c2,c3) VALUES(33,34); | ||
199 | 1009 | ERROR HY000: Failed to read auto-increment value from storage engine | ||
200 | 1010 | SELECT * FROM t5; | ||
201 | 1011 | c1 c2 c3 c4 c5 c6 c7 c8 | ||
202 | 1012 | 1 -9223372036854775808 1 2 3 4 5 5 | ||
203 | 1013 | 255 -2147483648 6 7 8 9 10 10 | ||
204 | 1014 | 65535 -8388608 11 12 13 14 15 15 | ||
205 | 1015 | 16777215 -32768 16 17 18 19 20 20 | ||
206 | 1016 | 4294967295 -128 21 22 23 24 25 25 | ||
207 | 1017 | 18446744073709551615 9223372036854775807 26 27 28 29 30 30 | ||
208 | 1018 | DROP TABLE t5; | ||
209 | 1019 | /* same test as above with signed bigint */ | ||
210 | 1020 | CREATE TABLE t5 ( | ||
211 | 1021 | c1 BIGINT SIGNED NOT NULL AUTO_INCREMENT, | ||
212 | 1022 | c2 BIGINT SIGNED NULL, | ||
213 | 1023 | c3 BIGINT SIGNED NOT NULL, | ||
214 | 1024 | c4 TINYINT, c5 SMALLINT, | ||
215 | 1025 | c6 MEDIUMINT, | ||
216 | 1026 | c7 INT, | ||
217 | 1027 | c8 INTEGER, | ||
218 | 1028 | PRIMARY KEY(c1,c2), UNIQUE INDEX(c3)); | ||
219 | 1029 | INSERT INTO t5 VALUES | ||
220 | 1030 | (0,-9223372036854775808,1,2,3,4,5,5), | ||
221 | 1031 | (255,-2147483648,6,7,8,9,10,10), | ||
222 | 1032 | (65535,-8388608,11,12,13,14,15,15), | ||
223 | 1033 | (16777215,-32768,16,17,18,19,20,20), | ||
224 | 1034 | (4294967295,-128,21,22,23,24,25,25), | ||
225 | 1035 | (9223372036854775807,9223372036854775807,26,27,28,29,30,30); | ||
226 | 1036 | INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */; | ||
227 | 1037 | ERROR HY000: Failed to read auto-increment value from storage engine | ||
228 | 1038 | INSERT INTO t5(c2,c3) VALUES(33,34); | ||
229 | 1039 | ERROR HY000: Failed to read auto-increment value from storage engine | ||
230 | 1040 | SELECT * FROM t5; | ||
231 | 1041 | c1 c2 c3 c4 c5 c6 c7 c8 | ||
232 | 1042 | 1 -9223372036854775808 1 2 3 4 5 5 | ||
233 | 1043 | 255 -2147483648 6 7 8 9 10 10 | ||
234 | 1044 | 65535 -8388608 11 12 13 14 15 15 | ||
235 | 1045 | 16777215 -32768 16 17 18 19 20 20 | ||
236 | 1046 | 4294967295 -128 21 22 23 24 25 25 | ||
237 | 1047 | 9223372036854775807 9223372036854775807 26 27 28 29 30 30 | ||
238 | 989 | 1048 | ||
239 | === modified file 'test/mysql-test/t/pbxt_bugs.test' | |||
240 | --- test/mysql-test/t/pbxt_bugs.test 2008-12-16 13:39:34 +0000 | |||
241 | +++ test/mysql-test/t/pbxt_bugs.test 2009-03-11 11:18:00 +0000 | |||
242 | @@ -807,3 +807,61 @@ | |||
243 | 807 | insert into t2 values ("1"); | 807 | insert into t2 values ("1"); |
244 | 808 | 808 | ||
245 | 809 | DROP TABLE IF EXISTS t2,t1; | 809 | DROP TABLE IF EXISTS t2,t1; |
246 | 810 | |||
247 | 811 | # bug 340316: Issue with bigint unsigned auto-increment field | ||
248 | 812 | |||
249 | 813 | --disable_warnings | ||
250 | 814 | DROP TABLE IF EXISTS t5; | ||
251 | 815 | --enable_warnings | ||
252 | 816 | CREATE TABLE t5 ( | ||
253 | 817 | c1 BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, | ||
254 | 818 | c2 BIGINT SIGNED NULL, | ||
255 | 819 | c3 BIGINT SIGNED NOT NULL, | ||
256 | 820 | c4 TINYINT, c5 SMALLINT, | ||
257 | 821 | c6 MEDIUMINT, | ||
258 | 822 | c7 INT, | ||
259 | 823 | c8 INTEGER, | ||
260 | 824 | PRIMARY KEY(c1,c2), UNIQUE INDEX(c3)); | ||
261 | 825 | |||
262 | 826 | INSERT INTO t5 VALUES | ||
263 | 827 | (0,-9223372036854775808,1,2,3,4,5,5), | ||
264 | 828 | (255,-2147483648,6,7,8,9,10,10), | ||
265 | 829 | (65535,-8388608,11,12,13,14,15,15), | ||
266 | 830 | (16777215,-32768,16,17,18,19,20,20), | ||
267 | 831 | (4294967295,-128,21,22,23,24,25,25), | ||
268 | 832 | (18446744073709551615,9223372036854775807,26,27,28,29,30,30); | ||
269 | 833 | |||
270 | 834 | --error 1467 | ||
271 | 835 | INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */; | ||
272 | 836 | --error 1467 | ||
273 | 837 | INSERT INTO t5(c2,c3) VALUES(33,34); | ||
274 | 838 | |||
275 | 839 | SELECT * FROM t5; | ||
276 | 840 | |||
277 | 841 | DROP TABLE t5; | ||
278 | 842 | |||
279 | 843 | /* same test as above with signed bigint */ | ||
280 | 844 | CREATE TABLE t5 ( | ||
281 | 845 | c1 BIGINT SIGNED NOT NULL AUTO_INCREMENT, | ||
282 | 846 | c2 BIGINT SIGNED NULL, | ||
283 | 847 | c3 BIGINT SIGNED NOT NULL, | ||
284 | 848 | c4 TINYINT, c5 SMALLINT, | ||
285 | 849 | c6 MEDIUMINT, | ||
286 | 850 | c7 INT, | ||
287 | 851 | c8 INTEGER, | ||
288 | 852 | PRIMARY KEY(c1,c2), UNIQUE INDEX(c3)); | ||
289 | 853 | |||
290 | 854 | INSERT INTO t5 VALUES | ||
291 | 855 | (0,-9223372036854775808,1,2,3,4,5,5), | ||
292 | 856 | (255,-2147483648,6,7,8,9,10,10), | ||
293 | 857 | (65535,-8388608,11,12,13,14,15,15), | ||
294 | 858 | (16777215,-32768,16,17,18,19,20,20), | ||
295 | 859 | (4294967295,-128,21,22,23,24,25,25), | ||
296 | 860 | (9223372036854775807,9223372036854775807,26,27,28,29,30,30); | ||
297 | 861 | |||
298 | 862 | --error 1467 | ||
299 | 863 | INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */; | ||
300 | 864 | --error 1467 | ||
301 | 865 | INSERT INTO t5(c2,c3) VALUES(33,34); | ||
302 | 866 | |||
303 | 867 | SELECT * FROM t5; |
Hi Vlad,
I am wondering why this is necessary!
Surely "fkey->co_name" should be freed by: key->release(self).
key->release(self) should call XTDDConstraint: :finalize( ):
virtual void finalize( XTThreadPtr self) { deleteAll( self); :finalize( self);
if (co_name)
xt_free(self, co_name);
if (co_ind_name)
xt_free(self, co_ind_name);
co_cols.
XTObject:
}
fkey is a XTDDForeignKey which is a XTDDIndex which is a XTDDConstraint.
On Mar 11, 2009, at 4:45 PM, Vladimir Kolesnikov wrote:
> === modified file 'src/datadic_xt.cc' table-> dt_fkeys. size(); i++) { table-> dt_fkeys. itemAt( i); (con_name, fkey->co_name) == table-> dt_fkeys. remove( fkey); self);
> --- src/datadic_xt.cc 2009-01-21 13:55:57 +0000
> +++ src/datadic_xt.cc 2009-03-11 15:38:29 +0000
> @@ -1513,6 +1513,7 @@
> for (i=0; i<ct_curr_
> fkey = ct_curr_
> if (fkey->co_name && myxt_strcasecmp
> 0) {
> + xt_free(self, fkey->co_name);
> ct_curr_
> fkey->release(
> }
-- ng.org
Paul McCullagh
PrimeBase Technologies
www.primebase.org
www.blobstreami
pbxt.blogspot.com