Merge lp:~brianaker/drizzle/bug_798959 into lp:~drizzle-trunk/drizzle/development
- bug_798959
- Merge into development
Proposed by
Brian Aker
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Brian Aker | ||||
Approved revision: | 2367 | ||||
Merged at revision: | 2368 | ||||
Proposed branch: | lp:~brianaker/drizzle/bug_798959 | ||||
Merge into: | lp:~drizzle-trunk/drizzle/development | ||||
Diff against target: |
494 lines (+112/-46) (has conflicts) 19 files modified
.bzrignore (+1/-0) drizzled/function/set_user_var.cc (+2/-0) drizzled/item/boolean.h (+20/-0) drizzled/item/cmpfunc.cc (+32/-22) drizzled/item/cmpfunc.h (+7/-4) drizzled/message.cc (+0/-6) drizzled/message.h (+0/-1) drizzled/set_var.cc (+1/-0) drizzled/signal_handler.cc (+1/-1) drizzled/sql_string.cc (+2/-2) drizzled/sql_string.h (+9/-0) drizzled/sql_yacc.yy (+3/-1) drizzled/util/backtrace.cc (+2/-3) drizzled/util/backtrace.h (+3/-1) plugin/debug/module.cc (+1/-1) plugin/utility_functions/tests/r/result_type.result (+2/-2) plugin/utility_functions/tests/r/typeof.result (+2/-2) tests/suite/regression/r/798959.result (+18/-0) tests/suite/regression/t/798959.test (+6/-0) Text conflict in drizzled/item/boolean.h Text conflict in drizzled/sql_string.h |
||||
To merge this branch: | bzr merge lp:~brianaker/drizzle/bug_798959 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Drizzle Merge Team | Pending | ||
Review via email: mp+68036@code.launchpad.net |
Commit message
Description of the change
Fix for 798959
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 '.bzrignore' | |||
2 | --- .bzrignore 2011-06-28 21:02:08 +0000 | |||
3 | +++ .bzrignore 2011-07-14 22:36:00 +0000 | |||
4 | @@ -359,3 +359,4 @@ | |||
5 | 359 | drizzled/execute/parser.output | 359 | drizzled/execute/parser.output |
6 | 360 | drizzled/execute/scanner.cc | 360 | drizzled/execute/scanner.cc |
7 | 361 | drizzled/execute/scanner.h | 361 | drizzled/execute/scanner.h |
8 | 362 | plugin/innobase/xtrabackup/drizzlebackup.innobase | ||
9 | 362 | 363 | ||
10 | === modified file 'drizzled/function/set_user_var.cc' | |||
11 | --- drizzled/function/set_user_var.cc 2011-05-28 16:23:09 +0000 | |||
12 | +++ drizzled/function/set_user_var.cc 2011-07-14 22:36:00 +0000 | |||
13 | @@ -144,8 +144,10 @@ | |||
14 | 144 | { | 144 | { |
15 | 145 | save_result.vint= use_result_field ? result_field->val_int() : | 145 | save_result.vint= use_result_field ? result_field->val_int() : |
16 | 146 | args[0]->val_int(); | 146 | args[0]->val_int(); |
17 | 147 | |||
18 | 147 | unsigned_flag= use_result_field ? ((Field_num*)result_field)->unsigned_flag: | 148 | unsigned_flag= use_result_field ? ((Field_num*)result_field)->unsigned_flag: |
19 | 148 | args[0]->unsigned_flag; | 149 | args[0]->unsigned_flag; |
20 | 150 | |||
21 | 149 | break; | 151 | break; |
22 | 150 | } | 152 | } |
23 | 151 | case STRING_RESULT: | 153 | case STRING_RESULT: |
24 | 152 | 154 | ||
25 | === modified file 'drizzled/item/boolean.h' | |||
26 | --- drizzled/item/boolean.h 2011-07-05 09:52:28 +0000 | |||
27 | +++ drizzled/item/boolean.h 2011-07-14 22:36:00 +0000 | |||
28 | @@ -20,6 +20,7 @@ | |||
29 | 20 | #pragma once | 20 | #pragma once |
30 | 21 | 21 | ||
31 | 22 | #include <drizzled/item/basic_constant.h> | 22 | #include <drizzled/item/basic_constant.h> |
32 | 23 | #include <drizzled/util/backtrace.h> | ||
33 | 23 | 24 | ||
34 | 24 | namespace drizzled { | 25 | namespace drizzled { |
35 | 25 | namespace item { | 26 | namespace item { |
36 | @@ -48,6 +49,11 @@ | |||
37 | 48 | 49 | ||
38 | 49 | enum Type type() const { return BOOLEAN_ITEM; } | 50 | enum Type type() const { return BOOLEAN_ITEM; } |
39 | 50 | 51 | ||
40 | 52 | Item_result result_type() const | ||
41 | 53 | { | ||
42 | 54 | return INT_RESULT; | ||
43 | 55 | } | ||
44 | 56 | |||
45 | 51 | virtual bool val_bool() | 57 | virtual bool val_bool() |
46 | 52 | { | 58 | { |
47 | 53 | return value; | 59 | return value; |
48 | @@ -55,6 +61,7 @@ | |||
49 | 55 | 61 | ||
50 | 56 | double val_real() | 62 | double val_real() |
51 | 57 | { | 63 | { |
52 | 64 | call_backtrace(); | ||
53 | 58 | return value ? 1 : 0; | 65 | return value ? 1 : 0; |
54 | 59 | } | 66 | } |
55 | 60 | 67 | ||
56 | @@ -66,7 +73,20 @@ | |||
57 | 66 | drizzled::String* val_str(drizzled::String *value_buffer) | 73 | drizzled::String* val_str(drizzled::String *value_buffer) |
58 | 67 | { | 74 | { |
59 | 68 | value_buffer->realloc(5); | 75 | value_buffer->realloc(5); |
60 | 76 | <<<<<<< TREE | ||
61 | 69 | value_buffer->append(value ? "TRUE" : "FALSE"); | 77 | value_buffer->append(value ? "TRUE" : "FALSE"); |
62 | 78 | ======= | ||
63 | 79 | |||
64 | 80 | if (value) | ||
65 | 81 | { | ||
66 | 82 | value_buffer->copy("TRUE", 4, default_charset()); | ||
67 | 83 | } | ||
68 | 84 | else | ||
69 | 85 | { | ||
70 | 86 | value_buffer->copy("FALSE", 5, default_charset()); | ||
71 | 87 | } | ||
72 | 88 | |||
73 | 89 | >>>>>>> MERGE-SOURCE | ||
74 | 70 | return value_buffer; | 90 | return value_buffer; |
75 | 71 | } | 91 | } |
76 | 72 | 92 | ||
77 | 73 | 93 | ||
78 | === modified file 'drizzled/item/cmpfunc.cc' | |||
79 | --- drizzled/item/cmpfunc.cc 2011-07-08 21:39:07 +0000 | |||
80 | +++ drizzled/item/cmpfunc.cc 2011-07-14 22:36:00 +0000 | |||
81 | @@ -26,6 +26,7 @@ | |||
82 | 26 | #include <drizzled/cached_item.h> | 26 | #include <drizzled/cached_item.h> |
83 | 27 | #include <drizzled/check_stack_overrun.h> | 27 | #include <drizzled/check_stack_overrun.h> |
84 | 28 | #include <drizzled/current_session.h> | 28 | #include <drizzled/current_session.h> |
85 | 29 | #include <drizzled/display.h> | ||
86 | 29 | #include <drizzled/error.h> | 30 | #include <drizzled/error.h> |
87 | 30 | #include <drizzled/internal/my_sys.h> | 31 | #include <drizzled/internal/my_sys.h> |
88 | 31 | #include <drizzled/item/cache_int.h> | 32 | #include <drizzled/item/cache_int.h> |
89 | @@ -33,11 +34,11 @@ | |||
90 | 33 | #include <drizzled/item/int_with_ref.h> | 34 | #include <drizzled/item/int_with_ref.h> |
91 | 34 | #include <drizzled/item/subselect.h> | 35 | #include <drizzled/item/subselect.h> |
92 | 35 | #include <drizzled/session.h> | 36 | #include <drizzled/session.h> |
93 | 37 | #include <drizzled/sql_lex.h> | ||
94 | 36 | #include <drizzled/sql_select.h> | 38 | #include <drizzled/sql_select.h> |
95 | 39 | #include <drizzled/system_variables.h> | ||
96 | 37 | #include <drizzled/temporal.h> | 40 | #include <drizzled/temporal.h> |
97 | 38 | #include <drizzled/time_functions.h> | 41 | #include <drizzled/time_functions.h> |
98 | 39 | #include <drizzled/sql_lex.h> | ||
99 | 40 | #include <drizzled/system_variables.h> | ||
100 | 41 | 42 | ||
101 | 42 | #include <math.h> | 43 | #include <math.h> |
102 | 43 | #include <algorithm> | 44 | #include <algorithm> |
103 | @@ -94,7 +95,9 @@ | |||
104 | 94 | for (; item < item_end; item++) | 95 | for (; item < item_end; item++) |
105 | 95 | { | 96 | { |
106 | 96 | if ((*item)->type() != Item::NULL_ITEM) | 97 | if ((*item)->type() != Item::NULL_ITEM) |
107 | 98 | { | ||
108 | 97 | *type= item_store_type(*type, *item, unsigned_flag); | 99 | *type= item_store_type(*type, *item, unsigned_flag); |
109 | 100 | } | ||
110 | 98 | } | 101 | } |
111 | 99 | } | 102 | } |
112 | 100 | 103 | ||
113 | @@ -2371,8 +2374,7 @@ | |||
114 | 2371 | } | 2374 | } |
115 | 2372 | 2375 | ||
116 | 2373 | 2376 | ||
119 | 2374 | void | 2377 | void Item_func_if::fix_length_and_dec() |
118 | 2375 | Item_func_if::fix_length_and_dec() | ||
120 | 2376 | { | 2378 | { |
121 | 2377 | maybe_null= args[1]->maybe_null || args[2]->maybe_null; | 2379 | maybe_null= args[1]->maybe_null || args[2]->maybe_null; |
122 | 2378 | decimals= max(args[1]->decimals, args[2]->decimals); | 2380 | decimals= max(args[1]->decimals, args[2]->decimals); |
123 | @@ -2397,32 +2399,38 @@ | |||
124 | 2397 | } | 2399 | } |
125 | 2398 | else | 2400 | else |
126 | 2399 | { | 2401 | { |
128 | 2400 | agg_result_type(&cached_result_type, args+1, 2); | 2402 | agg_result_type(&cached_result_type, args +1, 2); |
129 | 2401 | if (cached_result_type == STRING_RESULT) | 2403 | if (cached_result_type == STRING_RESULT) |
130 | 2402 | { | 2404 | { |
132 | 2403 | if (agg_arg_charsets(collation, args+1, 2, MY_COLL_ALLOW_CONV, 1)) | 2405 | if (agg_arg_charsets(collation, args +1, 2, MY_COLL_ALLOW_CONV, 1)) |
133 | 2404 | return; | 2406 | return; |
134 | 2405 | } | 2407 | } |
135 | 2406 | else | 2408 | else |
136 | 2407 | { | 2409 | { |
137 | 2408 | collation.set(&my_charset_bin); // Number | 2410 | collation.set(&my_charset_bin); // Number |
138 | 2409 | } | 2411 | } |
140 | 2410 | cached_field_type= agg_field_type(args + 1, 2); | 2412 | cached_field_type= agg_field_type(args +1, 2); |
141 | 2411 | } | 2413 | } |
142 | 2412 | 2414 | ||
145 | 2413 | if ((cached_result_type == DECIMAL_RESULT ) | 2415 | switch (cached_result_type) |
144 | 2414 | || (cached_result_type == INT_RESULT)) | ||
146 | 2415 | { | 2416 | { |
156 | 2416 | int len1= args[1]->max_length - args[1]->decimals | 2417 | case DECIMAL_RESULT: |
157 | 2417 | - (args[1]->unsigned_flag ? 0 : 1); | 2418 | case INT_RESULT: |
158 | 2418 | 2419 | { | |
159 | 2419 | int len2= args[2]->max_length - args[2]->decimals | 2420 | int len1= args[1]->max_length -args[1]->decimals -(args[1]->unsigned_flag ? 0 : 1); |
160 | 2420 | - (args[2]->unsigned_flag ? 0 : 1); | 2421 | int len2= args[2]->max_length -args[2]->decimals -(args[2]->unsigned_flag ? 0 : 1); |
161 | 2421 | 2422 | max_length= max(len1, len2) + decimals + (unsigned_flag ? 0 : 1); | |
162 | 2422 | max_length= max(len1, len2) + decimals + (unsigned_flag ? 0 : 1); | 2423 | } |
163 | 2423 | } | 2424 | break; |
164 | 2424 | else | 2425 | case REAL_RESULT: |
165 | 2426 | case STRING_RESULT: | ||
166 | 2425 | max_length= max(args[1]->max_length, args[2]->max_length); | 2427 | max_length= max(args[1]->max_length, args[2]->max_length); |
167 | 2428 | break; | ||
168 | 2429 | |||
169 | 2430 | case ROW_RESULT: | ||
170 | 2431 | assert(0); | ||
171 | 2432 | break; | ||
172 | 2433 | } | ||
173 | 2426 | } | 2434 | } |
174 | 2427 | 2435 | ||
175 | 2428 | 2436 | ||
176 | @@ -2449,8 +2457,8 @@ | |||
177 | 2449 | { | 2457 | { |
178 | 2450 | assert(fixed == 1); | 2458 | assert(fixed == 1); |
179 | 2451 | Item *arg= args[0]->val_bool() ? args[1] : args[2]; | 2459 | Item *arg= args[0]->val_bool() ? args[1] : args[2]; |
182 | 2452 | int64_t value=arg->val_int(); | 2460 | int64_t value= arg->val_int(); |
183 | 2453 | null_value=arg->null_value; | 2461 | null_value= arg->null_value; |
184 | 2454 | return value; | 2462 | return value; |
185 | 2455 | } | 2463 | } |
186 | 2456 | 2464 | ||
187 | @@ -2459,10 +2467,12 @@ | |||
188 | 2459 | { | 2467 | { |
189 | 2460 | assert(fixed == 1); | 2468 | assert(fixed == 1); |
190 | 2461 | Item *arg= args[0]->val_bool() ? args[1] : args[2]; | 2469 | Item *arg= args[0]->val_bool() ? args[1] : args[2]; |
192 | 2462 | String *res=arg->val_str(str); | 2470 | String *res= arg->val_str(str); |
193 | 2463 | if (res) | 2471 | if (res) |
194 | 2472 | { | ||
195 | 2464 | res->set_charset(collation.collation); | 2473 | res->set_charset(collation.collation); |
197 | 2465 | null_value=arg->null_value; | 2474 | } |
198 | 2475 | null_value= arg->null_value; | ||
199 | 2466 | return res; | 2476 | return res; |
200 | 2467 | } | 2477 | } |
201 | 2468 | 2478 | ||
202 | 2469 | 2479 | ||
203 | === modified file 'drizzled/item/cmpfunc.h' | |||
204 | --- drizzled/item/cmpfunc.h 2011-07-05 09:52:28 +0000 | |||
205 | +++ drizzled/item/cmpfunc.h 2011-07-14 22:36:00 +0000 | |||
206 | @@ -677,17 +677,20 @@ | |||
207 | 677 | 677 | ||
208 | 678 | class Item_func_if :public Item_func | 678 | class Item_func_if :public Item_func |
209 | 679 | { | 679 | { |
211 | 680 | enum Item_result cached_result_type; | 680 | Item_result cached_result_type; |
212 | 681 | enum_field_types cached_field_type; | 681 | enum_field_types cached_field_type; |
213 | 682 | |||
214 | 682 | public: | 683 | public: |
217 | 683 | Item_func_if(Item *a,Item *b,Item *c) | 684 | Item_func_if(Item *a, Item *b, Item *c) : |
218 | 684 | :Item_func(a,b,c), cached_result_type(INT_RESULT) | 685 | Item_func(a,b,c), |
219 | 686 | cached_result_type(INT_RESULT) | ||
220 | 685 | {} | 687 | {} |
221 | 688 | |||
222 | 686 | double val_real(); | 689 | double val_real(); |
223 | 687 | int64_t val_int(); | 690 | int64_t val_int(); |
224 | 688 | String *val_str(String *str); | 691 | String *val_str(String *str); |
225 | 689 | type::Decimal *val_decimal(type::Decimal *); | 692 | type::Decimal *val_decimal(type::Decimal *); |
227 | 690 | enum Item_result result_type () const { return cached_result_type; } | 693 | Item_result result_type () const { return cached_result_type; } |
228 | 691 | enum_field_types field_type() const { return cached_field_type; } | 694 | enum_field_types field_type() const { return cached_field_type; } |
229 | 692 | bool fix_fields(Session *, Item **); | 695 | bool fix_fields(Session *, Item **); |
230 | 693 | void fix_length_and_dec(); | 696 | void fix_length_and_dec(); |
231 | 694 | 697 | ||
232 | === modified file 'drizzled/message.cc' | |||
233 | --- drizzled/message.cc 2011-04-03 06:02:00 +0000 | |||
234 | +++ drizzled/message.cc 2011-07-14 22:36:00 +0000 | |||
235 | @@ -207,12 +207,6 @@ | |||
236 | 207 | return NO_ACTION; | 207 | return NO_ACTION; |
237 | 208 | } | 208 | } |
238 | 209 | 209 | ||
239 | 210 | // This matches SQL standard of using YES/NO not the normal TRUE/FALSE | ||
240 | 211 | const std::string &type(bool type) | ||
241 | 212 | { | ||
242 | 213 | return type ? YES : NO; | ||
243 | 214 | } | ||
244 | 215 | |||
245 | 216 | const std::string &type(drizzled::message::Table::Index::IndexType type) | 210 | const std::string &type(drizzled::message::Table::Index::IndexType type) |
246 | 217 | { | 211 | { |
247 | 218 | switch (type) | 212 | switch (type) |
248 | 219 | 213 | ||
249 | === modified file 'drizzled/message.h' | |||
250 | --- drizzled/message.h 2011-04-04 21:37:55 +0000 | |||
251 | +++ drizzled/message.h 2011-07-14 22:36:00 +0000 | |||
252 | @@ -42,7 +42,6 @@ | |||
253 | 42 | const std::string &type(const drizzled::message::Table::Field &type); | 42 | const std::string &type(const drizzled::message::Table::Field &type); |
254 | 43 | const std::string &type(drizzled::message::Table::Field::FieldType type); | 43 | const std::string &type(drizzled::message::Table::Field::FieldType type); |
255 | 44 | const std::string &type(drizzled::message::Table::ForeignKeyConstraint::ForeignKeyOption type); | 44 | const std::string &type(drizzled::message::Table::ForeignKeyConstraint::ForeignKeyOption type); |
256 | 45 | const std::string &type(bool type); | ||
257 | 46 | const std::string &type(drizzled::message::Table::Index::IndexType type); | 45 | const std::string &type(drizzled::message::Table::Index::IndexType type); |
258 | 47 | const std::string &type(drizzled::message::Table::ForeignKeyConstraint::ForeignKeyMatchOption type); | 46 | const std::string &type(drizzled::message::Table::ForeignKeyConstraint::ForeignKeyMatchOption type); |
259 | 48 | const std::string &type(drizzled::message::Table::TableType type); | 47 | const std::string &type(drizzled::message::Table::TableType type); |
260 | 49 | 48 | ||
261 | === modified file 'drizzled/set_var.cc' | |||
262 | --- drizzled/set_var.cc 2011-06-25 13:36:24 +0000 | |||
263 | +++ drizzled/set_var.cc 2011-07-14 22:36:00 +0000 | |||
264 | @@ -70,6 +70,7 @@ | |||
265 | 70 | error|= it->update(session); // Returns 0, -1 or 1 | 70 | error|= it->update(session); // Returns 0, -1 or 1 |
266 | 71 | } | 71 | } |
267 | 72 | } | 72 | } |
268 | 73 | |||
269 | 73 | err: | 74 | err: |
270 | 74 | free_underlaid_joins(session, &session->lex().select_lex); | 75 | free_underlaid_joins(session, &session->lex().select_lex); |
271 | 75 | return error; | 76 | return error; |
272 | 76 | 77 | ||
273 | === modified file 'drizzled/signal_handler.cc' | |||
274 | --- drizzled/signal_handler.cc 2011-04-20 09:27:49 +0000 | |||
275 | +++ drizzled/signal_handler.cc 2011-07-14 22:36:00 +0000 | |||
276 | @@ -153,7 +153,7 @@ | |||
277 | 153 | "Hope that's ok; if not, decrease some variables in the " | 153 | "Hope that's ok; if not, decrease some variables in the " |
278 | 154 | "equation.\n\n")); | 154 | "equation.\n\n")); |
279 | 155 | 155 | ||
281 | 156 | drizzled::util::custom_backtrace(); | 156 | call_backtrace(); |
282 | 157 | 157 | ||
283 | 158 | write_core(sig); | 158 | write_core(sig); |
284 | 159 | 159 | ||
285 | 160 | 160 | ||
286 | === modified file 'drizzled/sql_string.cc' | |||
287 | --- drizzled/sql_string.cc 2011-07-04 18:16:24 +0000 | |||
288 | +++ drizzled/sql_string.cc 2011-07-14 22:36:00 +0000 | |||
289 | @@ -286,14 +286,14 @@ | |||
290 | 286 | 286 | ||
291 | 287 | void String::append(const char *s,size_t arg_length) | 287 | void String::append(const char *s,size_t arg_length) |
292 | 288 | { | 288 | { |
294 | 289 | if (!arg_length) | 289 | if (arg_length == 0) |
295 | 290 | return; | 290 | return; |
296 | 291 | 291 | ||
297 | 292 | /* | 292 | /* |
298 | 293 | For an ASCII compatinble string we can just append. | 293 | For an ASCII compatinble string we can just append. |
299 | 294 | */ | 294 | */ |
300 | 295 | realloc(str_length+arg_length); | 295 | realloc(str_length+arg_length); |
302 | 296 | memcpy(Ptr+str_length,s,arg_length); | 296 | memcpy(Ptr +str_length, s, arg_length); |
303 | 297 | str_length+=arg_length; | 297 | str_length+=arg_length; |
304 | 298 | } | 298 | } |
305 | 299 | 299 | ||
306 | 300 | 300 | ||
307 | === modified file 'drizzled/sql_string.h' | |||
308 | --- drizzled/sql_string.h 2011-07-04 17:50:09 +0000 | |||
309 | +++ drizzled/sql_string.h 2011-07-14 22:36:00 +0000 | |||
310 | @@ -137,6 +137,7 @@ | |||
311 | 137 | Ptr= str; str_length=Alloced_length=arg_length ; alloced=0; | 137 | Ptr= str; str_length=Alloced_length=arg_length ; alloced=0; |
312 | 138 | str_charset=cs; | 138 | str_charset=cs; |
313 | 139 | } | 139 | } |
314 | 140 | |||
315 | 140 | inline void set(const char *str,size_t arg_length, const charset_info_st * const cs) | 141 | inline void set(const char *str,size_t arg_length, const charset_info_st * const cs) |
316 | 141 | { | 142 | { |
317 | 142 | free(); | 143 | free(); |
318 | @@ -145,6 +146,7 @@ | |||
319 | 145 | str_charset=cs; | 146 | str_charset=cs; |
320 | 146 | } | 147 | } |
321 | 147 | void set_ascii(const char *str, size_t arg_length); | 148 | void set_ascii(const char *str, size_t arg_length); |
322 | 149 | |||
323 | 148 | inline void set_quick(char *str,size_t arg_length, const charset_info_st * const cs) | 150 | inline void set_quick(char *str,size_t arg_length, const charset_info_st * const cs) |
324 | 149 | { | 151 | { |
325 | 150 | if (!alloced) | 152 | if (!alloced) |
326 | @@ -153,6 +155,7 @@ | |||
327 | 153 | } | 155 | } |
328 | 154 | str_charset= cs; | 156 | str_charset= cs; |
329 | 155 | } | 157 | } |
330 | 158 | |||
331 | 156 | void set_int(int64_t num, bool unsigned_flag, const charset_info_st * const cs); | 159 | void set_int(int64_t num, bool unsigned_flag, const charset_info_st * const cs); |
332 | 157 | void set(int64_t num, const charset_info_st * const cs) | 160 | void set(int64_t num, const charset_info_st * const cs) |
333 | 158 | { set_int(num, false, cs); } | 161 | { set_int(num, false, cs); } |
334 | @@ -243,7 +246,13 @@ | |||
335 | 243 | void copy(const String&); // Allocate new string | 246 | void copy(const String&); // Allocate new string |
336 | 244 | void copy(const std::string&, const charset_info_st*); // Allocate new string | 247 | void copy(const std::string&, const charset_info_st*); // Allocate new string |
337 | 245 | void copy(const char*, size_t, const charset_info_st*); // Allocate new string | 248 | void copy(const char*, size_t, const charset_info_st*); // Allocate new string |
338 | 249 | <<<<<<< TREE | ||
339 | 246 | static bool needs_conversion(size_t arg_length, const charset_info_st* cs_from, const charset_info_st* cs_to); | 250 | static bool needs_conversion(size_t arg_length, const charset_info_st* cs_from, const charset_info_st* cs_to); |
340 | 251 | ======= | ||
341 | 252 | static bool needs_conversion(size_t arg_length, | ||
342 | 253 | const charset_info_st* cs_from, const charset_info_st* cs_to, | ||
343 | 254 | size_t *offset); | ||
344 | 255 | >>>>>>> MERGE-SOURCE | ||
345 | 247 | void set_or_copy_aligned(const char *s, size_t arg_length, const charset_info_st*); | 256 | void set_or_copy_aligned(const char *s, size_t arg_length, const charset_info_st*); |
346 | 248 | void copy(const char*s,size_t arg_length, const charset_info_st& csto); | 257 | void copy(const char*s,size_t arg_length, const charset_info_st& csto); |
347 | 249 | void append(const String &s); | 258 | void append(const String &s); |
348 | 250 | 259 | ||
349 | === modified file 'drizzled/sql_yacc.yy' | |||
350 | --- drizzled/sql_yacc.yy 2011-07-01 18:59:28 +0000 | |||
351 | +++ drizzled/sql_yacc.yy 2011-07-14 22:36:00 +0000 | |||
352 | @@ -2999,7 +2999,9 @@ | |||
353 | 2999 | } | 2999 | } |
354 | 3000 | } | 3000 | } |
355 | 3001 | | IF '(' expr ',' expr ',' expr ')' | 3001 | | IF '(' expr ',' expr ',' expr ')' |
357 | 3002 | { $$= new (YYSession->mem_root) Item_func_if($3,$5,$7); } | 3002 | { |
358 | 3003 | $$= new (YYSession->mem_root) Item_func_if($3,$5,$7); | ||
359 | 3004 | } | ||
360 | 3003 | | KILL_SYM kill_option '(' expr ')' | 3005 | | KILL_SYM kill_option '(' expr ')' |
361 | 3004 | { | 3006 | { |
362 | 3005 | List<Item> *args= new (YYSession->mem_root) List<Item>; | 3007 | List<Item> *args= new (YYSession->mem_root) List<Item>; |
363 | 3006 | 3008 | ||
364 | === modified file 'drizzled/util/backtrace.cc' | |||
365 | --- drizzled/util/backtrace.cc 2011-02-17 00:14:13 +0000 | |||
366 | +++ drizzled/util/backtrace.cc 2011-07-14 22:36:00 +0000 | |||
367 | @@ -18,7 +18,6 @@ | |||
368 | 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
369 | 19 | */ | 19 | */ |
370 | 20 | 20 | ||
371 | 21 | |||
372 | 22 | #include <config.h> | 21 | #include <config.h> |
373 | 23 | #include <drizzled/util/backtrace.h> | 22 | #include <drizzled/util/backtrace.h> |
374 | 24 | 23 | ||
375 | @@ -33,14 +32,14 @@ | |||
376 | 33 | #endif // HAVE_BACKTRACE | 32 | #endif // HAVE_BACKTRACE |
377 | 34 | #endif // __GNUC__ | 33 | #endif // __GNUC__ |
378 | 35 | 34 | ||
379 | 36 | |||
380 | 37 | namespace drizzled | 35 | namespace drizzled |
381 | 38 | { | 36 | { |
382 | 39 | namespace util | 37 | namespace util |
383 | 40 | { | 38 | { |
384 | 41 | 39 | ||
386 | 42 | void custom_backtrace(void) | 40 | void custom_backtrace(const char *file, int line, const char *func) |
387 | 43 | { | 41 | { |
388 | 42 | std::cerr << std::endl << "call_backtrace() began at " << file << ":" << line << " for " << func << "()" << std::endl; | ||
389 | 44 | #ifdef __GNUC__ | 43 | #ifdef __GNUC__ |
390 | 45 | #ifdef HAVE_BACKTRACE | 44 | #ifdef HAVE_BACKTRACE |
391 | 46 | void *array[50]; | 45 | void *array[50]; |
392 | 47 | 46 | ||
393 | === modified file 'drizzled/util/backtrace.h' | |||
394 | --- drizzled/util/backtrace.h 2011-03-14 05:40:28 +0000 | |||
395 | +++ drizzled/util/backtrace.h 2011-07-14 22:36:00 +0000 | |||
396 | @@ -22,6 +22,8 @@ | |||
397 | 22 | 22 | ||
398 | 23 | #include <drizzled/visibility.h> | 23 | #include <drizzled/visibility.h> |
399 | 24 | 24 | ||
400 | 25 | #define call_backtrace() drizzled::util::custom_backtrace(__FILE__, __LINE__, __func__) | ||
401 | 26 | |||
402 | 25 | namespace drizzled | 27 | namespace drizzled |
403 | 26 | { | 28 | { |
404 | 27 | 29 | ||
405 | @@ -29,7 +31,7 @@ | |||
406 | 29 | { | 31 | { |
407 | 30 | 32 | ||
408 | 31 | DRIZZLED_API | 33 | DRIZZLED_API |
410 | 32 | void custom_backtrace(void); | 34 | void custom_backtrace(const char *file, int line, const char *func); |
411 | 33 | 35 | ||
412 | 34 | } /* namespace util */ | 36 | } /* namespace util */ |
413 | 35 | } /* namespace drizzled */ | 37 | } /* namespace drizzled */ |
414 | 36 | 38 | ||
415 | === modified file 'plugin/debug/module.cc' | |||
416 | --- plugin/debug/module.cc 2011-02-17 00:14:13 +0000 | |||
417 | +++ plugin/debug/module.cc 2011-07-14 22:36:00 +0000 | |||
418 | @@ -101,7 +101,7 @@ | |||
419 | 101 | 101 | ||
420 | 102 | bool val_bool() | 102 | bool val_bool() |
421 | 103 | { | 103 | { |
423 | 104 | util::custom_backtrace(); | 104 | call_backtrace(); |
424 | 105 | return true; | 105 | return true; |
425 | 106 | } | 106 | } |
426 | 107 | 107 | ||
427 | 108 | 108 | ||
428 | === modified file 'plugin/utility_functions/tests/r/result_type.result' | |||
429 | --- plugin/utility_functions/tests/r/result_type.result 2010-12-30 04:59:36 +0000 | |||
430 | +++ plugin/utility_functions/tests/r/result_type.result 2011-07-14 22:36:00 +0000 | |||
431 | @@ -3,10 +3,10 @@ | |||
432 | 3 | STRING | 3 | STRING |
433 | 4 | SELECT RESULT_TYPE(FALSE); | 4 | SELECT RESULT_TYPE(FALSE); |
434 | 5 | RESULT_TYPE(FALSE) | 5 | RESULT_TYPE(FALSE) |
436 | 6 | REAL | 6 | INTEGER |
437 | 7 | SELECT RESULT_TYPE(TRUE); | 7 | SELECT RESULT_TYPE(TRUE); |
438 | 8 | RESULT_TYPE(TRUE) | 8 | RESULT_TYPE(TRUE) |
440 | 9 | REAL | 9 | INTEGER |
441 | 10 | SELECT RESULT_TYPE(""); | 10 | SELECT RESULT_TYPE(""); |
442 | 11 | RESULT_TYPE("") | 11 | RESULT_TYPE("") |
443 | 12 | STRING | 12 | STRING |
444 | 13 | 13 | ||
445 | === modified file 'plugin/utility_functions/tests/r/typeof.result' | |||
446 | --- plugin/utility_functions/tests/r/typeof.result 2010-12-30 06:23:25 +0000 | |||
447 | +++ plugin/utility_functions/tests/r/typeof.result 2011-07-14 22:36:00 +0000 | |||
448 | @@ -3,10 +3,10 @@ | |||
449 | 3 | DRIZZLE_TYPE_NULL | 3 | DRIZZLE_TYPE_NULL |
450 | 4 | SELECT TYPEOF(FALSE); | 4 | SELECT TYPEOF(FALSE); |
451 | 5 | TYPEOF(FALSE) | 5 | TYPEOF(FALSE) |
453 | 6 | DRIZZLE_TYPE_DOUBLE | 6 | DRIZZLE_TYPE_LONGLONG |
454 | 7 | SELECT TYPEOF(TRUE); | 7 | SELECT TYPEOF(TRUE); |
455 | 8 | TYPEOF(TRUE) | 8 | TYPEOF(TRUE) |
457 | 9 | DRIZZLE_TYPE_DOUBLE | 9 | DRIZZLE_TYPE_LONGLONG |
458 | 10 | SELECT TYPEOF(""); | 10 | SELECT TYPEOF(""); |
459 | 11 | TYPEOF("") | 11 | TYPEOF("") |
460 | 12 | DRIZZLE_TYPE_VARCHAR | 12 | DRIZZLE_TYPE_VARCHAR |
461 | 13 | 13 | ||
462 | === added file 'tests/suite/regression/r/798959.result' | |||
463 | --- tests/suite/regression/r/798959.result 1970-01-01 00:00:00 +0000 | |||
464 | +++ tests/suite/regression/r/798959.result 2011-07-14 22:36:00 +0000 | |||
465 | @@ -0,0 +1,18 @@ | |||
466 | 1 | SELECT IF(true, result_type(1), 'yes'); | ||
467 | 2 | IF(true, result_type(1), 'yes') | ||
468 | 3 | INTEGER | ||
469 | 4 | SELECT IF(true, typeof(1), 'yes'); | ||
470 | 5 | IF(true, typeof(1), 'yes') | ||
471 | 6 | DRIZZLE_TYPE_LONGLONG | ||
472 | 7 | SELECT IF(true, result_type(true), 'yes'); | ||
473 | 8 | IF(true, result_type(true), 'yes') | ||
474 | 9 | INTEGER | ||
475 | 10 | SELECT IF(true, typeof(true), 'yes'); | ||
476 | 11 | IF(true, typeof(true), 'yes') | ||
477 | 12 | DRIZZLE_TYPE_LONGLONG | ||
478 | 13 | SELECT IF(true, true, 'yes'); | ||
479 | 14 | IF(true, true, 'yes') | ||
480 | 15 | TRUE | ||
481 | 16 | SELECT IF(true, true, ''); | ||
482 | 17 | IF(true, true, '') | ||
483 | 18 | TRUE | ||
484 | 0 | 19 | ||
485 | === added file 'tests/suite/regression/t/798959.test' | |||
486 | --- tests/suite/regression/t/798959.test 1970-01-01 00:00:00 +0000 | |||
487 | +++ tests/suite/regression/t/798959.test 2011-07-14 22:36:00 +0000 | |||
488 | @@ -0,0 +1,6 @@ | |||
489 | 1 | SELECT IF(true, result_type(1), 'yes'); | ||
490 | 2 | SELECT IF(true, typeof(1), 'yes'); | ||
491 | 3 | SELECT IF(true, result_type(true), 'yes'); | ||
492 | 4 | SELECT IF(true, typeof(true), 'yes'); | ||
493 | 5 | SELECT IF(true, true, 'yes'); | ||
494 | 6 | SELECT IF(true, true, ''); |