Merge lp:~brianaker/drizzle/error-fix into lp:drizzle/7.0

Proposed by Brian Aker
Status: Merged
Approved by: Brian Aker
Approved revision: 2186
Merged at revision: 2187
Proposed branch: lp:~brianaker/drizzle/error-fix
Merge into: lp:drizzle/7.0
Diff against target: 1413 lines (+212/-200)
42 files modified
configure.ac (+1/-0)
drizzled/errmsg_print.cc (+16/-0)
drizzled/field.cc (+12/-12)
drizzled/field.h (+15/-15)
drizzled/field/blob.cc (+8/-9)
drizzled/field/blob.h (+7/-7)
drizzled/field/boolean.cc (+14/-14)
drizzled/field/boolean.h (+4/-4)
drizzled/field/date.cc (+5/-5)
drizzled/field/date.h (+5/-5)
drizzled/field/datetime.cc (+5/-6)
drizzled/field/datetime.h (+5/-5)
drizzled/field/decimal.cc (+4/-5)
drizzled/field/decimal.h (+4/-4)
drizzled/field/double.cc (+3/-4)
drizzled/field/double.h (+3/-3)
drizzled/field/enum.cc (+3/-3)
drizzled/field/enum.h (+3/-3)
drizzled/field/epoch.cc (+6/-6)
drizzled/field/epoch.h (+6/-6)
drizzled/field/int32.cc (+3/-3)
drizzled/field/int32.h (+3/-3)
drizzled/field/int64.cc (+3/-3)
drizzled/field/int64.h (+3/-3)
drizzled/field/microtime.cc (+7/-7)
drizzled/field/microtime.h (+7/-7)
drizzled/field/null.h (+10/-10)
drizzled/field/num.cc (+1/-1)
drizzled/field/num.h (+1/-1)
drizzled/field/real.cc (+1/-1)
drizzled/field/real.h (+1/-1)
drizzled/field/size.cc (+3/-3)
drizzled/field/size.h (+3/-3)
drizzled/field/str.cc (+1/-1)
drizzled/field/str.h (+1/-1)
drizzled/field/time.cc (+8/-8)
drizzled/field/time.h (+8/-8)
drizzled/field/uuid.cc (+5/-5)
drizzled/field/uuid.h (+5/-5)
drizzled/field/varstring.cc (+4/-5)
drizzled/field/varstring.h (+4/-4)
drizzled/table.h (+1/-1)
To merge this branch: bzr merge lp:~brianaker/drizzle/error-fix
Reviewer Review Type Date Requested Status
Drizzle Developers Pending
Review via email: mp+50501@code.launchpad.net

Description of the change

Additional field const + fixes error message such that we correctly populate the error if GNU has been defined.

To post a comment you must log in.
lp:~brianaker/drizzle/error-fix updated
2187. By Brian Aker

Merge in additional header bits for strerror_r

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2011-02-13 17:26:39 +0000
3+++ configure.ac 2011-02-20 21:39:20 +0000
4@@ -72,6 +72,7 @@
5 PANDORA_REQUIRE_LIBREADLINE
6 PANDORA_REQUIRE_LIBDL
7 AC_LANG_POP
8+AC_FUNC_STRERROR_R
9
10 DRIZZLE_STACK_DIRECTION
11
12
13=== modified file 'drizzled/errmsg_print.cc'
14--- drizzled/errmsg_print.cc 2011-02-17 00:14:13 +0000
15+++ drizzled/errmsg_print.cc 2011-02-20 21:39:20 +0000
16@@ -36,10 +36,19 @@
17
18 void sql_perror(const char *message)
19 {
20+ char *errmsg_ptr;
21 char errmsg[STRERROR_MAX];
22 errmsg[0]= 0;
23+
24+#ifdef STRERROR_R_CHAR_P
25+ errmsg_ptr= strerror_r(errno, errmsg, sizeof(errmsg));
26+#else
27 strerror_r(errno, errmsg, sizeof(errmsg));
28+ errmsg_ptr= errmsg;
29+#endif
30+
31 errmsg_printf(error::ERROR, "%s: %s\n", message, errmsg);
32+
33 }
34
35 // @todo Cap the size of message.
36@@ -52,9 +61,16 @@
37 // @todo Cap the size of message/extra.
38 void sql_perror(std::string message, const std::string &extra)
39 {
40+ char *errmsg_ptr;
41 char errmsg[STRERROR_MAX];
42 errmsg[0]= 0;
43+
44+#ifdef STRERROR_R_CHAR_P
45+ errmsg_ptr= strerror_r(errno, errmsg, sizeof(errmsg));
46+#else
47 strerror_r(errno, errmsg, sizeof(errmsg));
48+ errmsg_ptr= errmsg;
49+#endif
50
51 if (not extra.empty())
52 {
53
54=== modified file 'drizzled/field.cc'
55--- drizzled/field.cc 2011-02-17 00:14:13 +0000
56+++ drizzled/field.cc 2011-02-20 21:39:20 +0000
57@@ -746,26 +746,26 @@
58 return 0;
59 }
60
61-bool Field::is_null(ptrdiff_t row_offset)
62+bool Field::is_null(ptrdiff_t row_offset) const
63 {
64 return null_ptr ?
65 (null_ptr[row_offset] & null_bit ? true : false) :
66 table->null_row;
67 }
68
69-bool Field::is_real_null(ptrdiff_t row_offset)
70+bool Field::is_real_null(ptrdiff_t row_offset) const
71 {
72 return null_ptr ? (null_ptr[row_offset] & null_bit ? true : false) : false;
73 }
74
75-bool Field::is_null_in_record(const unsigned char *record)
76+bool Field::is_null_in_record(const unsigned char *record) const
77 {
78 if (! null_ptr)
79 return false;
80 return test(record[(uint32_t) (null_ptr -table->getInsertRecord())] & null_bit);
81 }
82
83-bool Field::is_null_in_record_with_offset(ptrdiff_t with_offset)
84+bool Field::is_null_in_record_with_offset(ptrdiff_t with_offset) const
85 {
86 if (! null_ptr)
87 return false;
88@@ -784,12 +784,12 @@
89 null_ptr[row_offset]&= (unsigned char) ~null_bit;
90 }
91
92-bool Field::maybe_null(void)
93+bool Field::maybe_null(void) const
94 {
95 return null_ptr != 0 || table->maybe_null;
96 }
97
98-bool Field::real_maybe_null(void)
99+bool Field::real_maybe_null(void) const
100 {
101 return null_ptr != 0;
102 }
103@@ -851,7 +851,7 @@
104 {
105 }
106
107-void Field::hash(uint32_t *nr, uint32_t *nr2)
108+void Field::hash(uint32_t *nr, uint32_t *nr2) const
109 {
110 if (is_null())
111 {
112@@ -943,7 +943,7 @@
113 return(result);
114 }
115
116-type::Decimal *Field::val_decimal(type::Decimal *)
117+type::Decimal *Field::val_decimal(type::Decimal *) const
118 {
119 /* This never have to be called */
120 assert(0);
121@@ -1012,14 +1012,14 @@
122 return copy->length+ store_length;
123 }
124
125-bool Field::get_date(type::Time &ltime, uint32_t fuzzydate)
126+bool Field::get_date(type::Time &ltime, uint32_t fuzzydate) const
127 {
128 char buff[type::Time::MAX_STRING_LENGTH];
129 String tmp(buff,sizeof(buff),&my_charset_bin),*res;
130
131 assert(getTable() and getTable()->getSession());
132
133- if (not (res=val_str_internal(&tmp)) or
134+ if (not (res= val_str_internal(&tmp)) or
135 str_to_datetime_with_warn(getTable()->getSession(),
136 res->ptr(), res->length(),
137 &ltime, fuzzydate) <= type::DRIZZLE_TIMESTAMP_ERROR)
138@@ -1030,7 +1030,7 @@
139 return false;
140 }
141
142-bool Field::get_time(type::Time &ltime)
143+bool Field::get_time(type::Time &ltime) const
144 {
145 char buff[type::Time::MAX_STRING_LENGTH];
146 String tmp(buff,sizeof(buff),&my_charset_bin),*res;
147@@ -1253,7 +1253,7 @@
148 }
149 }
150
151-bool Field::isReadSet()
152+bool Field::isReadSet() const
153 {
154 return table->isReadSet(field_index);
155 }
156
157=== modified file 'drizzled/field.h'
158--- drizzled/field.h 2011-02-17 00:14:13 +0000
159+++ drizzled/field.h 2011-02-20 21:39:20 +0000
160@@ -217,10 +217,10 @@
161 Needs to be changed if/when we want to support different time formats.
162 */
163 virtual int store_time(type::Time &ltime, type::timestamp_t t_type);
164- virtual double val_real()=0;
165- virtual int64_t val_int()=0;
166- virtual type::Decimal *val_decimal(type::Decimal *);
167- String *val_str_internal(String *str)
168+ virtual double val_real() const=0;
169+ virtual int64_t val_int() const =0;
170+ virtual type::Decimal *val_decimal(type::Decimal *) const;
171+ String *val_str_internal(String *str) const
172 {
173 return val_str(str, str);
174 }
175@@ -237,7 +237,7 @@
176 an unnecessary free (and later, may be an alloc).
177 This trickery is used to decrease a number of malloc calls.
178 */
179- virtual String *val_str(String*, String *)=0;
180+ virtual String *val_str(String*, String *) const =0;
181
182 /*
183 str_needs_quotes() returns true if the value returned by val_str() needs
184@@ -363,14 +363,14 @@
185 // For new field
186 virtual uint32_t size_of() const =0;
187
188- bool is_null(ptrdiff_t row_offset= 0);
189- bool is_real_null(ptrdiff_t row_offset= 0);
190- bool is_null_in_record(const unsigned char *record);
191- bool is_null_in_record_with_offset(ptrdiff_t offset);
192+ bool is_null(ptrdiff_t row_offset= 0) const;
193+ bool is_real_null(ptrdiff_t row_offset= 0) const;
194+ bool is_null_in_record(const unsigned char *record) const;
195+ bool is_null_in_record_with_offset(ptrdiff_t offset) const;
196 void set_null(ptrdiff_t row_offset= 0);
197 void set_notnull(ptrdiff_t row_offset= 0);
198- bool maybe_null(void);
199- bool real_maybe_null(void);
200+ bool maybe_null(void) const;
201+ bool real_maybe_null(void) const;
202
203 virtual void make_field(SendField *);
204 virtual void sort_string(unsigned char *buff,uint32_t length)=0;
205@@ -596,8 +596,8 @@
206 }
207 void copy_from_tmp(int offset);
208 uint32_t fill_cache_field(CacheField *copy);
209- virtual bool get_date(type::Time &ltime,uint32_t fuzzydate);
210- virtual bool get_time(type::Time &ltime);
211+ virtual bool get_date(type::Time &ltime,uint32_t fuzzydate) const;
212+ virtual bool get_time(type::Time &ltime) const;
213 virtual const CHARSET_INFO *charset(void) const { return &my_charset_bin; }
214 virtual const CHARSET_INFO *sort_charset(void) const { return charset(); }
215 virtual bool has_charset(void) const { return false; }
216@@ -738,7 +738,7 @@
217 }
218
219 /* Hash value */
220- virtual void hash(uint32_t *nr, uint32_t *nr2);
221+ virtual void hash(uint32_t *nr, uint32_t *nr2) const;
222 friend bool reopen_table(Session *,Table *,bool);
223
224 friend class CopyField;
225@@ -754,7 +754,7 @@
226 friend class Item_sum_max;
227 friend class Item_func_group_concat;
228
229- bool isReadSet();
230+ bool isReadSet() const;
231 bool isWriteSet();
232 void setReadSet(bool arg= true);
233 void setWriteSet(bool arg= true);
234
235=== modified file 'drizzled/field/blob.cc'
236--- drizzled/field/blob.cc 2011-02-17 00:14:13 +0000
237+++ drizzled/field/blob.cc 2011-02-20 21:39:20 +0000
238@@ -90,7 +90,7 @@
239
240
241 uint32_t Field_blob::get_length(const unsigned char *pos,
242- bool low_byte_first)
243+ bool low_byte_first) const
244 {
245 #ifndef WORDS_BIGENDIAN
246 (void)low_byte_first;
247@@ -113,14 +113,14 @@
248 }
249
250
251-uint32_t Field_blob::get_length(uint32_t row_offset)
252+uint32_t Field_blob::get_length(uint32_t row_offset) const
253 {
254 return get_length(ptr+row_offset,
255 getTable()->getShare()->db_low_byte_first);
256 }
257
258
259-uint32_t Field_blob::get_length(const unsigned char *ptr_arg)
260+uint32_t Field_blob::get_length(const unsigned char *ptr_arg) const
261 {
262 return get_length(ptr_arg, getTable()->getShare()->db_low_byte_first);
263 }
264@@ -224,7 +224,7 @@
265 }
266
267
268-double Field_blob::val_real(void)
269+double Field_blob::val_real(void) const
270 {
271 int not_used;
272 char *end_not_used, *blob;
273@@ -242,7 +242,7 @@
274 }
275
276
277-int64_t Field_blob::val_int(void)
278+int64_t Field_blob::val_int(void) const
279 {
280 int not_used;
281 char *blob;
282@@ -252,12 +252,11 @@
283 memcpy(&blob,ptr+sizeof(uint32_t),sizeof(char*));
284 if (!blob)
285 return 0;
286- uint32_t length=get_length(ptr);
287+ uint32_t length= get_length(ptr);
288 return my_strntoll(charset(),blob,length,10,NULL,&not_used);
289 }
290
291-String *Field_blob::val_str(String *,
292- String *val_ptr)
293+String *Field_blob::val_str(String *, String *val_ptr) const
294 {
295 char *blob;
296
297@@ -272,7 +271,7 @@
298 }
299
300
301-type::Decimal *Field_blob::val_decimal(type::Decimal *decimal_value)
302+type::Decimal *Field_blob::val_decimal(type::Decimal *decimal_value) const
303 {
304 const char *blob;
305 size_t length;
306
307=== modified file 'drizzled/field/blob.h'
308--- drizzled/field/blob.h 2011-02-17 00:14:13 +0000
309+++ drizzled/field/blob.h 2011-02-20 21:39:20 +0000
310@@ -77,10 +77,10 @@
311 int store(double nr);
312 int store(int64_t nr, bool unsigned_val);
313
314- double val_real(void);
315- int64_t val_int(void);
316- String *val_str(String*,String *);
317- type::Decimal *val_decimal(type::Decimal *);
318+ double val_real(void) const;
319+ int64_t val_int(void) const;
320+ String *val_str(String*,String *) const;
321+ type::Decimal *val_decimal(type::Decimal *) const;
322 int cmp_max(const unsigned char *, const unsigned char *, uint32_t max_length);
323 int cmp(const unsigned char *a,const unsigned char *b)
324 { return cmp_max(a, b, UINT32_MAX); }
325@@ -132,9 +132,9 @@
326 */
327 uint32_t get_packed_size(const unsigned char *ptr_arg, bool low_byte_first);
328
329- DRIZZLED_API uint32_t get_length(uint32_t row_offset= 0);
330- DRIZZLED_API uint32_t get_length(const unsigned char *ptr, bool low_byte_first);
331- DRIZZLED_API uint32_t get_length(const unsigned char *ptr_arg);
332+ DRIZZLED_API uint32_t get_length(uint32_t row_offset= 0) const;
333+ DRIZZLED_API uint32_t get_length(const unsigned char *ptr, bool low_byte_first) const;
334+ DRIZZLED_API uint32_t get_length(const unsigned char *ptr_arg) const;
335 void put_length(unsigned char *pos, uint32_t length);
336 inline void get_ptr(unsigned char **str)
337 {
338
339=== modified file 'drizzled/field/boolean.cc'
340--- drizzled/field/boolean.cc 2011-02-17 00:14:13 +0000
341+++ drizzled/field/boolean.cc 2011-02-20 21:39:20 +0000
342@@ -123,19 +123,19 @@
343 res.set_ascii(STRING_WITH_LEN("boolean"));
344 }
345
346-double Boolean::val_real()
347-{
348- ASSERT_COLUMN_MARKED_FOR_READ;
349- return isTrue();
350-}
351-
352-int64_t Boolean::val_int()
353-{
354- ASSERT_COLUMN_MARKED_FOR_READ;
355- return isTrue();
356-}
357-
358-String *Boolean::val_str(String *val_buffer, String *)
359+double Boolean::val_real() const
360+{
361+ ASSERT_COLUMN_MARKED_FOR_READ;
362+ return isTrue();
363+}
364+
365+int64_t Boolean::val_int() const
366+{
367+ ASSERT_COLUMN_MARKED_FOR_READ;
368+ return isTrue();
369+}
370+
371+String *Boolean::val_str(String *val_buffer, String *) const
372 {
373 ASSERT_COLUMN_MARKED_FOR_READ;
374
375@@ -144,7 +144,7 @@
376 return val_buffer;
377 }
378
379-type::Decimal *Boolean::val_decimal(type::Decimal *dec)
380+type::Decimal *Boolean::val_decimal(type::Decimal *dec) const
381 {
382 if (isTrue())
383 {
384
385=== modified file 'drizzled/field/boolean.h'
386--- drizzled/field/boolean.h 2011-02-02 20:10:49 +0000
387+++ drizzled/field/boolean.h 2011-02-20 21:39:20 +0000
388@@ -52,10 +52,10 @@
389 int store(int64_t nr, bool unsigned_val);
390 int store_decimal(const drizzled::type::Decimal*);
391
392- String *val_str(String*,String *);
393- double val_real();
394- int64_t val_int();
395- type::Decimal *val_decimal(type::Decimal *);
396+ String *val_str(String*,String *) const;
397+ double val_real() const;
398+ int64_t val_int() const;
399+ type::Decimal *val_decimal(type::Decimal *) const;
400
401 void sql_type(drizzled::String&) const;
402
403
404=== modified file 'drizzled/field/date.cc'
405--- drizzled/field/date.cc 2011-02-17 00:14:13 +0000
406+++ drizzled/field/date.cc 2011-02-20 21:39:20 +0000
407@@ -173,12 +173,12 @@
408 return error;
409 }
410
411-double Field_date::val_real(void)
412+double Field_date::val_real(void) const
413 {
414 return (double) Field_date::val_int();
415 }
416
417-int64_t Field_date::val_int(void)
418+int64_t Field_date::val_int(void) const
419 {
420 uint32_t j;
421
422@@ -189,7 +189,7 @@
423 return (int64_t) j;
424 }
425
426-String *Field_date::val_str(String *val_buffer, String *)
427+String *Field_date::val_str(String *val_buffer, String *) const
428 {
429 val_buffer->alloc(field_length);
430 val_buffer->length(field_length);
431@@ -217,7 +217,7 @@
432 return val_buffer;
433 }
434
435-bool Field_date::get_date(type::Time &ltime, uint32_t fuzzydate)
436+bool Field_date::get_date(type::Time &ltime, uint32_t fuzzydate) const
437 {
438 uint32_t tmp=(uint32_t) uint4korr(ptr);
439 ltime.day= (int) (tmp%100);
440@@ -230,7 +230,7 @@
441 1 : 0);
442 }
443
444-bool Field_date::get_time(type::Time &ltime)
445+bool Field_date::get_time(type::Time &ltime) const
446 {
447 return Field_date::get_date(ltime ,0);
448 }
449
450=== modified file 'drizzled/field/date.h'
451--- drizzled/field/date.h 2011-02-14 22:31:26 +0000
452+++ drizzled/field/date.h 2011-02-20 21:39:20 +0000
453@@ -66,17 +66,17 @@
454 int store(int64_t nr, bool unsigned_val);
455 int store_time(type::Time &ltime, type::timestamp_t type);
456 int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; }
457- double val_real(void);
458- int64_t val_int(void);
459- String *val_str(String*,String *);
460+ double val_real(void) const;
461+ int64_t val_int(void) const;
462+ String *val_str(String*,String *) const;
463 int cmp(const unsigned char *,const unsigned char *);
464 void sort_string(unsigned char *buff,uint32_t length);
465 uint32_t pack_length() const { return 4; }
466 void sql_type(String &str) const;
467 bool can_be_compared_as_int64_t() const { return true; }
468 bool zero_pack() const { return 1; }
469- bool get_date(type::Time &ltime,uint32_t fuzzydate);
470- bool get_time(type::Time &ltime);
471+ bool get_date(type::Time &ltime,uint32_t fuzzydate) const;
472+ bool get_time(type::Time &ltime) const;
473 };
474
475 } /* namespace drizzled */
476
477=== modified file 'drizzled/field/datetime.cc'
478--- drizzled/field/datetime.cc 2011-02-17 00:14:13 +0000
479+++ drizzled/field/datetime.cc 2011-02-20 21:39:20 +0000
480@@ -158,12 +158,12 @@
481 return 0;
482 }
483
484-double Field_datetime::val_real(void)
485+double Field_datetime::val_real(void) const
486 {
487 return (double) Field_datetime::val_int();
488 }
489
490-int64_t Field_datetime::val_int(void)
491+int64_t Field_datetime::val_int(void) const
492 {
493 int64_t j;
494
495@@ -179,8 +179,7 @@
496 }
497
498
499-String *Field_datetime::val_str(String *val_buffer,
500- String *)
501+String *Field_datetime::val_str(String *val_buffer, String *) const
502 {
503 val_buffer->alloc(DateTime::MAX_STRING_LENGTH);
504 val_buffer->length(DateTime::MAX_STRING_LENGTH);
505@@ -217,7 +216,7 @@
506 return val_buffer;
507 }
508
509-bool Field_datetime::get_date(type::Time &ltime, uint32_t fuzzydate)
510+bool Field_datetime::get_date(type::Time &ltime, uint32_t fuzzydate) const
511 {
512 int64_t tmp=Field_datetime::val_int();
513 uint32_t part1,part2;
514@@ -237,7 +236,7 @@
515 return (!(fuzzydate & TIME_FUZZY_DATE) && (!ltime.month || !ltime.day)) ? 1 : 0;
516 }
517
518-bool Field_datetime::get_time(type::Time &ltime)
519+bool Field_datetime::get_time(type::Time &ltime) const
520 {
521 return Field_datetime::get_date(ltime,0);
522 }
523
524=== modified file 'drizzled/field/datetime.h'
525--- drizzled/field/datetime.h 2011-02-14 22:31:26 +0000
526+++ drizzled/field/datetime.h 2011-02-20 21:39:20 +0000
527@@ -69,17 +69,17 @@
528 ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0;
529 return 0;
530 }
531- double val_real(void);
532- int64_t val_int(void);
533- String *val_str(String*,String *);
534+ double val_real(void) const;
535+ int64_t val_int(void) const;
536+ String *val_str(String*,String *) const;
537 int cmp(const unsigned char *,const unsigned char *);
538 void sort_string(unsigned char *buff,uint32_t length);
539 uint32_t pack_length() const { return 8; }
540 void sql_type(String &str) const;
541 bool can_be_compared_as_int64_t() const { return true; }
542 bool zero_pack() const { return 1; }
543- bool get_date(type::Time &ltime,uint32_t fuzzydate);
544- bool get_time(type::Time &ltime);
545+ bool get_date(type::Time &ltime,uint32_t fuzzydate) const;
546+ bool get_time(type::Time &ltime) const;
547 };
548
549 } /* namespace drizzled */
550
551=== modified file 'drizzled/field/decimal.cc'
552--- drizzled/field/decimal.cc 2011-02-17 00:14:13 +0000
553+++ drizzled/field/decimal.cc 2011-02-20 21:39:20 +0000
554@@ -260,7 +260,7 @@
555 }
556
557
558-double Field_decimal::val_real(void)
559+double Field_decimal::val_real(void) const
560 {
561 double dbl;
562 type::Decimal decimal_value;
563@@ -273,7 +273,7 @@
564 }
565
566
567-int64_t Field_decimal::val_int(void)
568+int64_t Field_decimal::val_int(void) const
569 {
570 int64_t i;
571 type::Decimal decimal_value;
572@@ -286,7 +286,7 @@
573 }
574
575
576-type::Decimal* Field_decimal::val_decimal(type::Decimal *decimal_value)
577+type::Decimal* Field_decimal::val_decimal(type::Decimal *decimal_value) const
578 {
579 ASSERT_COLUMN_MARKED_FOR_READ;
580
581@@ -296,8 +296,7 @@
582 }
583
584
585-String *Field_decimal::val_str(String *val_buffer,
586- String *)
587+String *Field_decimal::val_str(String *val_buffer, String *) const
588 {
589 type::Decimal decimal_value;
590
591
592=== modified file 'drizzled/field/decimal.h'
593--- drizzled/field/decimal.h 2011-02-03 06:31:52 +0000
594+++ drizzled/field/decimal.h 2011-02-20 21:39:20 +0000
595@@ -70,10 +70,10 @@
596 int store(int64_t nr, bool unsigned_val);
597 int store_time(type::Time &ltime, type::timestamp_t t_type);
598 int store_decimal(const type::Decimal *);
599- double val_real(void);
600- int64_t val_int(void);
601- type::Decimal *val_decimal(type::Decimal *);
602- String *val_str(String*, String *);
603+ double val_real(void) const;
604+ int64_t val_int(void) const;
605+ type::Decimal *val_decimal(type::Decimal *) const;
606+ String *val_str(String*, String *) const;
607 int cmp(const unsigned char *, const unsigned char *);
608 void sort_string(unsigned char *buff, uint32_t length);
609 bool zero_pack() const { return 0; }
610
611=== modified file 'drizzled/field/double.cc'
612--- drizzled/field/double.cc 2011-02-17 00:14:13 +0000
613+++ drizzled/field/double.cc 2011-02-20 21:39:20 +0000
614@@ -84,7 +84,7 @@
615 (double) nr);
616 }
617
618-double Field_double::val_real(void)
619+double Field_double::val_real(void) const
620 {
621 double j;
622
623@@ -101,7 +101,7 @@
624 return j;
625 }
626
627-int64_t Field_double::val_int(void)
628+int64_t Field_double::val_int(void) const
629 {
630 double j;
631 int64_t res;
632@@ -144,8 +144,7 @@
633 }
634
635
636-String *Field_double::val_str(String *val_buffer,
637- String *)
638+String *Field_double::val_str(String *val_buffer, String *) const
639 {
640 double nr;
641
642
643=== modified file 'drizzled/field/double.h'
644--- drizzled/field/double.h 2010-02-26 08:21:58 +0000
645+++ drizzled/field/double.h 2011-02-20 21:39:20 +0000
646@@ -59,9 +59,9 @@
647 int store(double nr);
648 int store(int64_t nr, bool unsigned_val);
649 int reset(void) { memset(ptr, 0, sizeof(double)); return 0; }
650- double val_real(void);
651- int64_t val_int(void);
652- String *val_str(String*,String *);
653+ double val_real(void) const;
654+ int64_t val_int(void) const;
655+ String *val_str(String*,String *) const;
656 int cmp(const unsigned char *,const unsigned char *);
657 void sort_string(unsigned char *buff,uint32_t length);
658 uint32_t pack_length() const { return sizeof(double); }
659
660=== modified file 'drizzled/field/enum.cc'
661--- drizzled/field/enum.cc 2011-02-17 00:14:13 +0000
662+++ drizzled/field/enum.cc 2011-02-20 21:39:20 +0000
663@@ -121,12 +121,12 @@
664 return 0;
665 }
666
667-double Field_enum::val_real(void)
668+double Field_enum::val_real(void) const
669 {
670 return (double) Field_enum::val_int();
671 }
672
673-int64_t Field_enum::val_int(void)
674+int64_t Field_enum::val_int(void) const
675 {
676 ASSERT_COLUMN_MARKED_FOR_READ;
677
678@@ -140,7 +140,7 @@
679 return ((int64_t) tmp) + 1; /* SQL is from 1, we store from 0 */
680 }
681
682-String *Field_enum::val_str(String *, String *val_ptr)
683+String *Field_enum::val_str(String *, String *val_ptr) const
684 {
685 uint32_t tmp=(uint32_t) Field_enum::val_int();
686
687
688=== modified file 'drizzled/field/enum.h'
689--- drizzled/field/enum.h 2011-02-17 00:14:13 +0000
690+++ drizzled/field/enum.h 2011-02-20 21:39:20 +0000
691@@ -61,9 +61,9 @@
692 int store(const char *to, uint32_t length, const CHARSET_INFO * const);
693 int store(double nr);
694 int store(int64_t nr, bool unsigned_val);
695- double val_real(void);
696- int64_t val_int(void);
697- String *val_str(String*, String *);
698+ double val_real(void) const;
699+ int64_t val_int(void) const;
700+ String *val_str(String*, String *) const;
701 int cmp(const unsigned char *, const unsigned char *);
702 void sort_string(unsigned char *buff, uint32_t length);
703 void store_type(uint64_t value);
704
705=== modified file 'drizzled/field/epoch.cc'
706--- drizzled/field/epoch.cc 2011-02-17 00:14:13 +0000
707+++ drizzled/field/epoch.cc 2011-02-20 21:39:20 +0000
708@@ -236,12 +236,12 @@
709 return 0;
710 }
711
712-double Epoch::val_real(void)
713+double Epoch::val_real(void) const
714 {
715 return (double) Epoch::val_int();
716 }
717
718-int64_t Epoch::val_int(void)
719+int64_t Epoch::val_int(void) const
720 {
721 uint64_t temp;
722
723@@ -258,7 +258,7 @@
724 return result;
725 }
726
727-String *Epoch::val_str(String *val_buffer, String *)
728+String *Epoch::val_str(String *val_buffer, String *) const
729 {
730 uint64_t temp= 0;
731 char *to;
732@@ -282,7 +282,7 @@
733 return val_buffer;
734 }
735
736-bool Epoch::get_date(type::Time &ltime, uint32_t)
737+bool Epoch::get_date(type::Time &ltime, uint32_t) const
738 {
739 uint64_t temp;
740 type::Time::epoch_t time_temp;
741@@ -297,7 +297,7 @@
742 return 0;
743 }
744
745-bool Epoch::get_time(type::Time &ltime)
746+bool Epoch::get_time(type::Time &ltime) const
747 {
748 return Epoch::get_date(ltime, 0);
749 }
750@@ -368,7 +368,7 @@
751 }
752 }
753
754-long Epoch::get_timestamp(bool *null_value)
755+long Epoch::get_timestamp(bool *null_value) const
756 {
757 if ((*null_value= is_null()))
758 return 0;
759
760=== modified file 'drizzled/field/epoch.h'
761--- drizzled/field/epoch.h 2011-01-25 05:20:15 +0000
762+++ drizzled/field/epoch.h 2011-02-20 21:39:20 +0000
763@@ -58,9 +58,9 @@
764 int store_decimal(const type::Decimal *value);
765
766 int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0; return 0; }
767- double val_real(void);
768- int64_t val_int(void);
769- String *val_str(String*,String *);
770+ double val_real(void) const;
771+ int64_t val_int(void) const;
772+ String *val_str(String*,String *) const;
773 int cmp(const unsigned char *,const unsigned char *);
774 void sort_string(unsigned char *buff,uint32_t length);
775 uint32_t pack_length() const { return 8; }
776@@ -71,7 +71,7 @@
777 virtual void set_default();
778
779 /* Get TIMESTAMP field value as seconds since begging of Unix Epoch */
780- virtual long get_timestamp(bool *null_value);
781+ virtual long get_timestamp(bool *null_value) const;
782
783 virtual bool is_timestamp() const
784 {
785@@ -79,8 +79,8 @@
786 }
787
788 private:
789- bool get_date(type::Time &ltime,uint32_t fuzzydate);
790- bool get_time(type::Time &ltime);
791+ bool get_date(type::Time &ltime,uint32_t fuzzydate) const;
792+ bool get_time(type::Time &ltime) const;
793
794 public:
795 virtual timestamp_auto_set_type get_auto_set_type() const;
796
797=== modified file 'drizzled/field/int32.cc'
798--- drizzled/field/int32.cc 2011-02-17 00:14:13 +0000
799+++ drizzled/field/int32.cc 2011-02-20 21:39:20 +0000
800@@ -121,7 +121,7 @@
801 }
802
803
804- double Int32::val_real(void)
805+ double Int32::val_real(void) const
806 {
807 int32_t j;
808
809@@ -132,7 +132,7 @@
810 return (double) j;
811 }
812
813- int64_t Int32::val_int(void)
814+ int64_t Int32::val_int(void) const
815 {
816 int32_t j;
817
818@@ -143,7 +143,7 @@
819 return (int64_t) j;
820 }
821
822- String *Int32::val_str(String *val_buffer, String *)
823+ String *Int32::val_str(String *val_buffer, String *) const
824 {
825 const CHARSET_INFO * const cs= &my_charset_bin;
826 uint32_t length;
827
828=== modified file 'drizzled/field/int32.h'
829--- drizzled/field/int32.h 2010-12-18 00:43:02 +0000
830+++ drizzled/field/int32.h 2011-02-20 21:39:20 +0000
831@@ -62,9 +62,9 @@
832 int store(double nr);
833 int store(int64_t nr, bool unsigned_val);
834 int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; }
835- double val_real(void);
836- int64_t val_int(void);
837- String *val_str(String*,String *);
838+ double val_real(void) const;
839+ int64_t val_int(void) const;
840+ String *val_str(String*,String *) const;
841 int cmp(const unsigned char *,const unsigned char *);
842 void sort_string(unsigned char *buff,uint32_t length);
843 uint32_t pack_length() const { return 4; }
844
845=== modified file 'drizzled/field/int64.cc'
846--- drizzled/field/int64.cc 2011-02-17 00:14:13 +0000
847+++ drizzled/field/int64.cc 2011-02-20 21:39:20 +0000
848@@ -121,7 +121,7 @@
849 }
850
851
852-double Int64::val_real(void)
853+double Int64::val_real(void) const
854 {
855 int64_t j;
856
857@@ -134,7 +134,7 @@
858 }
859
860
861-int64_t Int64::val_int(void)
862+int64_t Int64::val_int(void) const
863 {
864 int64_t j;
865
866@@ -146,7 +146,7 @@
867 }
868
869
870-String *Int64::val_str(String *val_buffer, String *)
871+String *Int64::val_str(String *val_buffer, String *) const
872 {
873 const CHARSET_INFO * const cs= &my_charset_bin;
874 uint32_t length;
875
876=== modified file 'drizzled/field/int64.h'
877--- drizzled/field/int64.h 2011-02-14 22:31:26 +0000
878+++ drizzled/field/int64.h 2011-02-20 21:39:20 +0000
879@@ -80,9 +80,9 @@
880 ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0;
881 return 0;
882 }
883- double val_real(void);
884- int64_t val_int(void);
885- String *val_str(String*,String *);
886+ double val_real(void) const;
887+ int64_t val_int(void) const;
888+ String *val_str(String*,String *) const;
889 int cmp(const unsigned char *,const unsigned char *);
890 void sort_string(unsigned char *buff,uint32_t length);
891 uint32_t pack_length() const { return 8; }
892
893=== modified file 'drizzled/field/microtime.cc'
894--- drizzled/field/microtime.cc 2011-02-17 00:14:13 +0000
895+++ drizzled/field/microtime.cc 2011-02-20 21:39:20 +0000
896@@ -158,7 +158,7 @@
897 return 0;
898 }
899
900-double Microtime::val_real(void)
901+double Microtime::val_real(void) const
902 {
903 uint64_t temp;
904 type::Time::usec_t micro_temp;
905@@ -180,7 +180,7 @@
906 return result;
907 }
908
909-type::Decimal *Microtime::val_decimal(type::Decimal *decimal_value)
910+type::Decimal *Microtime::val_decimal(type::Decimal *decimal_value) const
911 {
912 type::Time ltime;
913
914@@ -189,7 +189,7 @@
915 return date2_class_decimal(&ltime, decimal_value);
916 }
917
918-int64_t Microtime::val_int(void)
919+int64_t Microtime::val_int(void) const
920 {
921 uint64_t temp;
922
923@@ -207,7 +207,7 @@
924 return result;
925 }
926
927-String *Microtime::val_str(String *val_buffer, String *)
928+String *Microtime::val_str(String *val_buffer, String *) const
929 {
930 uint64_t temp= 0;
931 type::Time::usec_t micro_temp= 0;
932@@ -224,7 +224,7 @@
933 return val_buffer;
934 }
935
936-bool Microtime::get_date(type::Time &ltime, uint32_t)
937+bool Microtime::get_date(type::Time &ltime, uint32_t) const
938 {
939 uint64_t temp;
940 uint32_t micro_temp= 0;
941@@ -239,7 +239,7 @@
942 return false;
943 }
944
945-bool Microtime::get_time(type::Time &ltime)
946+bool Microtime::get_time(type::Time &ltime) const
947 {
948 return Microtime::get_date(ltime, 0);
949 }
950@@ -294,7 +294,7 @@
951 pack_num(fractional_seconds, ptr +8);
952 }
953
954-long Microtime::get_timestamp(bool *null_value)
955+long Microtime::get_timestamp(bool *null_value) const
956 {
957 if ((*null_value= is_null()))
958 return 0;
959
960=== modified file 'drizzled/field/microtime.h'
961--- drizzled/field/microtime.h 2011-01-25 05:20:15 +0000
962+++ drizzled/field/microtime.h 2011-02-20 21:39:20 +0000
963@@ -56,10 +56,10 @@
964 int store(int64_t nr, bool unsigned_val);
965 int store_time(type::Time &ltime, type::timestamp_t t_type);
966
967- String *val_str(String*,String *);
968- double val_real(void);
969- int64_t val_int(void);
970- type::Decimal *val_decimal(type::Decimal *decimal_value);
971+ String *val_str(String*,String *) const;
972+ double val_real(void) const;
973+ int64_t val_int(void) const;
974+ type::Decimal *val_decimal(type::Decimal *decimal_value) const;
975
976 int cmp(const unsigned char *,const unsigned char *);
977 void sort_string(unsigned char *buff,uint32_t length);
978@@ -70,11 +70,11 @@
979 void set_time();
980
981 /* Get TIMESTAMP field value as seconds since begging of Unix Microtime */
982- long get_timestamp(bool *null_value);
983+ long get_timestamp(bool *null_value) const;
984
985 private:
986- bool get_date(type::Time &ltime,uint32_t fuzzydate);
987- bool get_time(type::Time &ltime);
988+ bool get_date(type::Time &ltime,uint32_t fuzzydate) const;
989+ bool get_time(type::Time &ltime) const;
990
991 public:
992 static size_t max_string_length()
993
994=== modified file 'drizzled/field/null.h'
995--- drizzled/field/null.h 2011-02-14 22:31:26 +0000
996+++ drizzled/field/null.h 2011-02-20 21:39:20 +0000
997@@ -79,19 +79,19 @@
998 {
999 return 0;
1000 }
1001- double val_real(void)
1002+ double val_real(void) const
1003 {
1004 return 0.0;
1005 }
1006- int64_t val_int(void)
1007- {
1008- return 0;
1009- }
1010- type::Decimal *val_decimal(type::Decimal *)
1011- {
1012- return 0;
1013- }
1014- String *val_str(String *, String *value2)
1015+ int64_t val_int(void) const
1016+ {
1017+ return 0;
1018+ }
1019+ type::Decimal *val_decimal(type::Decimal *) const
1020+ {
1021+ return 0;
1022+ }
1023+ String *val_str(String *, String *value2) const
1024 {
1025 value2->length(0);
1026 return value2;
1027
1028=== modified file 'drizzled/field/num.cc'
1029--- drizzled/field/num.cc 2011-02-17 00:14:13 +0000
1030+++ drizzled/field/num.cc 2011-02-20 21:39:20 +0000
1031@@ -189,7 +189,7 @@
1032 pointer to decimal buffer with value of field
1033 */
1034
1035-type::Decimal* Field_num::val_decimal(type::Decimal *decimal_value)
1036+type::Decimal* Field_num::val_decimal(type::Decimal *decimal_value) const
1037 {
1038 assert(result_type() == INT_RESULT);
1039
1040
1041=== modified file 'drizzled/field/num.h'
1042--- drizzled/field/num.h 2011-02-17 00:14:13 +0000
1043+++ drizzled/field/num.h 2011-02-20 21:39:20 +0000
1044@@ -52,7 +52,7 @@
1045
1046 int store_decimal(const type::Decimal *);
1047
1048- type::Decimal *val_decimal(type::Decimal *);
1049+ type::Decimal *val_decimal(type::Decimal *) const;
1050
1051 uint32_t is_equal(CreateField *new_field);
1052
1053
1054=== modified file 'drizzled/field/real.cc'
1055--- drizzled/field/real.cc 2011-02-17 00:14:13 +0000
1056+++ drizzled/field/real.cc 2011-02-20 21:39:20 +0000
1057@@ -136,7 +136,7 @@
1058 return store(dbl);
1059 }
1060
1061-type::Decimal *Field_real::val_decimal(type::Decimal *decimal_value)
1062+type::Decimal *Field_real::val_decimal(type::Decimal *decimal_value) const
1063 {
1064 ASSERT_COLUMN_MARKED_FOR_READ;
1065
1066
1067=== modified file 'drizzled/field/real.h'
1068--- drizzled/field/real.h 2010-12-25 01:27:46 +0000
1069+++ drizzled/field/real.h 2011-02-20 21:39:20 +0000
1070@@ -43,7 +43,7 @@
1071 not_fixed(dec_arg >= NOT_FIXED_DEC)
1072 {}
1073 int store_decimal(const type::Decimal *);
1074- type::Decimal *val_decimal(type::Decimal *);
1075+ type::Decimal *val_decimal(type::Decimal *) const;
1076 int truncate(double *nr, double max_length);
1077 uint32_t max_display_length() { return field_length; }
1078 uint32_t size_of() const { return sizeof(*this); }
1079
1080=== modified file 'drizzled/field/size.cc'
1081--- drizzled/field/size.cc 2011-02-17 00:14:13 +0000
1082+++ drizzled/field/size.cc 2011-02-20 21:39:20 +0000
1083@@ -157,7 +157,7 @@
1084 }
1085
1086
1087-double Size::val_real(void)
1088+double Size::val_real(void) const
1089 {
1090 int64_t j;
1091
1092@@ -169,7 +169,7 @@
1093 }
1094
1095
1096-int64_t Size::val_int(void)
1097+int64_t Size::val_int(void) const
1098 {
1099 int64_t j;
1100
1101@@ -181,7 +181,7 @@
1102 }
1103
1104
1105-String *Size::val_str(String *val_buffer, String *)
1106+String *Size::val_str(String *val_buffer, String *) const
1107 {
1108 const CHARSET_INFO * const cs= &my_charset_bin;
1109 uint32_t length;
1110
1111=== modified file 'drizzled/field/size.h'
1112--- drizzled/field/size.h 2011-02-14 22:31:26 +0000
1113+++ drizzled/field/size.h 2011-02-20 21:39:20 +0000
1114@@ -60,9 +60,9 @@
1115 ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0;
1116 return 0;
1117 }
1118- double val_real(void);
1119- int64_t val_int(void);
1120- String *val_str(String*,String *);
1121+ double val_real(void) const;
1122+ int64_t val_int(void) const;
1123+ String *val_str(String*,String *) const;
1124 int cmp(const unsigned char *,const unsigned char *);
1125 void sort_string(unsigned char *buff,uint32_t length);
1126 uint32_t pack_length() const { return 8; }
1127
1128=== modified file 'drizzled/field/str.cc'
1129--- drizzled/field/str.cc 2011-02-17 00:14:13 +0000
1130+++ drizzled/field/str.cc 2011-02-20 21:39:20 +0000
1131@@ -110,7 +110,7 @@
1132 return store(str.ptr(), str.length(), str.charset());
1133 }
1134
1135-type::Decimal *Field_str::val_decimal(type::Decimal *decimal_value)
1136+type::Decimal *Field_str::val_decimal(type::Decimal *decimal_value) const
1137 {
1138 int64_t nr= val_int();
1139 int2_class_decimal(E_DEC_FATAL_ERROR, nr, 0, decimal_value);
1140
1141=== modified file 'drizzled/field/str.h'
1142--- drizzled/field/str.h 2011-02-17 00:14:13 +0000
1143+++ drizzled/field/str.h 2011-02-20 21:39:20 +0000
1144@@ -65,7 +65,7 @@
1145 bool binary() const { return field_charset == &my_charset_bin; }
1146 uint32_t max_display_length() { return field_length; }
1147 friend class CreateField;
1148- type::Decimal *val_decimal(type::Decimal *);
1149+ type::Decimal *val_decimal(type::Decimal *) const;
1150 virtual bool str_needs_quotes() { return true; }
1151 uint32_t max_data_length() const;
1152 };
1153
1154=== modified file 'drizzled/field/time.cc'
1155--- drizzled/field/time.cc 2011-02-17 00:14:13 +0000
1156+++ drizzled/field/time.cc 2011-02-20 21:39:20 +0000
1157@@ -161,7 +161,7 @@
1158 memcpy(ptr, &tmp, sizeof(int32_t));
1159 }
1160
1161-void Time::unpack_time(drizzled::Time &temporal)
1162+void Time::unpack_time(drizzled::Time &temporal) const
1163 {
1164 int32_t tmp;
1165
1166@@ -171,18 +171,18 @@
1167 temporal.from_int32_t(tmp);
1168 }
1169
1170-void Time::unpack_time(int32_t &destination, const unsigned char *source)
1171+void Time::unpack_time(int32_t &destination, const unsigned char *source) const
1172 {
1173 memcpy(&destination, source, sizeof(int32_t));
1174 destination= htonl(destination);
1175 }
1176
1177-double Time::val_real(void)
1178+double Time::val_real(void) const
1179 {
1180 return (double) Time::val_int();
1181 }
1182
1183-int64_t Time::val_int(void)
1184+int64_t Time::val_int(void) const
1185 {
1186 ASSERT_COLUMN_MARKED_FOR_READ;
1187
1188@@ -195,7 +195,7 @@
1189 return result;
1190 }
1191
1192-String *Time::val_str(String *val_buffer, String *)
1193+String *Time::val_str(String *val_buffer, String *) const
1194 {
1195 char *to;
1196 int to_len= field_length + 1;
1197@@ -216,7 +216,7 @@
1198 return val_buffer;
1199 }
1200
1201-bool Time::get_date(type::Time &ltime, uint32_t)
1202+bool Time::get_date(type::Time &ltime, uint32_t) const
1203 {
1204 ltime.reset();
1205
1206@@ -234,7 +234,7 @@
1207 return 0;
1208 }
1209
1210-bool Time::get_time(type::Time &ltime)
1211+bool Time::get_time(type::Time &ltime) const
1212 {
1213 return Time::get_date(ltime, 0);
1214 }
1215@@ -275,7 +275,7 @@
1216 res.set_ascii(STRING_WITH_LEN("timestamp"));
1217 }
1218
1219-long Time::get_timestamp(bool *null_value)
1220+long Time::get_timestamp(bool *null_value) const
1221 {
1222 if ((*null_value= is_null()))
1223 return 0;
1224
1225=== modified file 'drizzled/field/time.h'
1226--- drizzled/field/time.h 2011-02-14 22:31:26 +0000
1227+++ drizzled/field/time.h 2011-02-20 21:39:20 +0000
1228@@ -53,9 +53,9 @@
1229 int store(double nr);
1230 int store(int64_t nr, bool unsigned_val);
1231 int reset(void) { ptr[0]= ptr[1]= ptr[2]= ptr[3]= 0; return 0; }
1232- double val_real(void);
1233- int64_t val_int(void);
1234- String *val_str(String*,String *);
1235+ double val_real(void) const;
1236+ int64_t val_int(void) const;
1237+ String *val_str(String*,String *) const;
1238 int cmp(const unsigned char *,const unsigned char *);
1239 void sort_string(unsigned char *buff,uint32_t length);
1240 uint32_t pack_length() const { return 4; }
1241@@ -64,17 +64,17 @@
1242 bool zero_pack() const { return 0; }
1243
1244 /* Get TIME field value as seconds since begging of Unix Epoch */
1245- long get_timestamp(bool *null_value);
1246+ long get_timestamp(bool *null_value) const;
1247 private:
1248- bool get_date(type::Time &ltime,uint32_t fuzzydate);
1249- bool get_time(type::Time &ltime);
1250+ bool get_date(type::Time &ltime, uint32_t fuzzydate) const;
1251+ bool get_time(type::Time &ltime) const;
1252
1253 public:
1254 timestamp_auto_set_type get_auto_set_type() const;
1255 static size_t max_string_length();
1256 void pack_time(drizzled::Time &arg);
1257- void unpack_time(drizzled::Time &arg);
1258- void unpack_time(int32_t &destination, const unsigned char *source);
1259+ void unpack_time(drizzled::Time &arg) const;
1260+ void unpack_time(int32_t &destination, const unsigned char *source) const;
1261 };
1262
1263 } /* namespace field */
1264
1265=== modified file 'drizzled/field/uuid.cc'
1266--- drizzled/field/uuid.cc 2011-02-17 00:14:13 +0000
1267+++ drizzled/field/uuid.cc 2011-02-20 21:39:20 +0000
1268@@ -103,14 +103,14 @@
1269 res.set_ascii(STRING_WITH_LEN("uuid"));
1270 }
1271
1272-double Uuid::val_real()
1273+double Uuid::val_real() const
1274 {
1275 ASSERT_COLUMN_MARKED_FOR_READ;
1276 my_error(ER_INVALID_UUID_VALUE, MYF(ME_FATALERROR));
1277 return 0;
1278 }
1279
1280-int64_t Uuid::val_int()
1281+int64_t Uuid::val_int() const
1282 {
1283 ASSERT_COLUMN_MARKED_FOR_READ;
1284 my_error(ER_INVALID_UUID_VALUE, MYF(ME_FATALERROR));
1285@@ -133,7 +133,7 @@
1286 }
1287 #endif
1288
1289-String *Uuid::val_str(String *val_buffer, String *)
1290+String *Uuid::val_str(String *val_buffer, String *) const
1291 {
1292 const CHARSET_INFO * const cs= &my_charset_bin;
1293 uint32_t mlength= (type::Uuid::DISPLAY_BUFFER_LENGTH) * cs->mbmaxlen;
1294@@ -158,7 +158,7 @@
1295 memcpy(to, ptr, length_arg);
1296 }
1297
1298-bool Uuid::get_date(type::Time &ltime, uint32_t )
1299+bool Uuid::get_date(type::Time &ltime, uint32_t ) const
1300 {
1301 type::Uuid uu;
1302
1303@@ -181,7 +181,7 @@
1304 return true;
1305 }
1306
1307-bool Uuid::get_time(type::Time &ltime)
1308+bool Uuid::get_time(type::Time &ltime) const
1309 {
1310 return get_date(ltime, 0);
1311 }
1312
1313=== modified file 'drizzled/field/uuid.h'
1314--- drizzled/field/uuid.h 2011-02-17 00:14:13 +0000
1315+++ drizzled/field/uuid.h 2011-02-20 21:39:20 +0000
1316@@ -51,9 +51,9 @@
1317
1318 int store(const char *to, uint32_t length, const CHARSET_INFO * const charset);
1319 int store(int64_t nr, bool unsigned_val);
1320- double val_real();
1321- int64_t val_int();
1322- String *val_str(String*,String *);
1323+ double val_real() const;
1324+ int64_t val_int() const;
1325+ String *val_str(String*,String *) const;
1326 void sql_type(drizzled::String&) const;
1327 int store_decimal(const drizzled::type::Decimal*);
1328
1329@@ -66,8 +66,8 @@
1330 inline String *val_str(String *str) { return val_str(str, str); }
1331 uint32_t size_of() const { return sizeof(*this); }
1332
1333- bool get_date(type::Time &ltime, uint32_t);
1334- bool get_time(type::Time &ltime);
1335+ bool get_date(type::Time &ltime, uint32_t) const;
1336+ bool get_time(type::Time &ltime) const;
1337
1338 #ifdef NOT_YET
1339 void generate();
1340
1341=== modified file 'drizzled/field/varstring.cc'
1342--- drizzled/field/varstring.cc 2011-02-17 00:14:13 +0000
1343+++ drizzled/field/varstring.cc 2011-02-20 21:39:20 +0000
1344@@ -124,7 +124,7 @@
1345 }
1346
1347
1348-double Field_varstring::val_real(void)
1349+double Field_varstring::val_real(void) const
1350 {
1351 int not_used;
1352 char *end_not_used;
1353@@ -138,7 +138,7 @@
1354 }
1355
1356
1357-int64_t Field_varstring::val_int(void)
1358+int64_t Field_varstring::val_int(void) const
1359 {
1360 int not_used;
1361 char *end_not_used;
1362@@ -152,8 +152,7 @@
1363 &end_not_used, &not_used);
1364 }
1365
1366-String *Field_varstring::val_str(String *,
1367- String *val_ptr)
1368+String *Field_varstring::val_str(String *, String *val_ptr) const
1369 {
1370 uint32_t length= length_bytes == 1 ? (uint32_t) *ptr : uint2korr(ptr);
1371
1372@@ -165,7 +164,7 @@
1373 }
1374
1375
1376-type::Decimal *Field_varstring::val_decimal(type::Decimal *decimal_value)
1377+type::Decimal *Field_varstring::val_decimal(type::Decimal *decimal_value) const
1378 {
1379 uint32_t length;
1380
1381
1382=== modified file 'drizzled/field/varstring.h'
1383--- drizzled/field/varstring.h 2010-12-25 01:27:46 +0000
1384+++ drizzled/field/varstring.h 2011-02-20 21:39:20 +0000
1385@@ -74,11 +74,11 @@
1386
1387 int store(int64_t nr, bool unsigned_val);
1388 int store(double nr) { return Field_str::store(nr); } /* QQ: To be deleted */
1389- double val_real(void);
1390- int64_t val_int(void);
1391- String *val_str(String*,String *);
1392+ double val_real(void) const;
1393+ int64_t val_int(void) const;
1394+ String *val_str(String*,String *) const;
1395 inline String *val_str(String *str) { return val_str(str, str); }
1396- type::Decimal *val_decimal(type::Decimal *);
1397+ type::Decimal *val_decimal(type::Decimal *) const;
1398 int cmp_max(const unsigned char *, const unsigned char *, uint32_t max_length);
1399 inline int cmp(const unsigned char *str) { return cmp(ptr,str); }
1400 int cmp(const unsigned char *a,const unsigned char *b)
1401
1402=== modified file 'drizzled/table.h'
1403--- drizzled/table.h 2011-02-17 00:14:13 +0000
1404+++ drizzled/table.h 2011-02-20 21:39:20 +0000
1405@@ -499,7 +499,7 @@
1406 }
1407
1408 /* Both of the below should go away once we can move this bit to the field objects */
1409- inline bool isReadSet(uint32_t index)
1410+ inline bool isReadSet(uint32_t index) const
1411 {
1412 return read_set->test(index);
1413 }

Subscribers

People subscribed via source and target branches