Merge lp:~brianaker/drizzle/error-fix into lp:drizzle/7.0
- error-fix
- Merge into 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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Drizzle Developers | Pending | ||
Review via email: mp+50501@code.launchpad.net |
Commit message
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 | 72 | PANDORA_REQUIRE_LIBREADLINE | 72 | PANDORA_REQUIRE_LIBREADLINE |
6 | 73 | PANDORA_REQUIRE_LIBDL | 73 | PANDORA_REQUIRE_LIBDL |
7 | 74 | AC_LANG_POP | 74 | AC_LANG_POP |
8 | 75 | AC_FUNC_STRERROR_R | ||
9 | 75 | 76 | ||
10 | 76 | DRIZZLE_STACK_DIRECTION | 77 | DRIZZLE_STACK_DIRECTION |
11 | 77 | 78 | ||
12 | 78 | 79 | ||
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 | 36 | 36 | ||
18 | 37 | void sql_perror(const char *message) | 37 | void sql_perror(const char *message) |
19 | 38 | { | 38 | { |
20 | 39 | char *errmsg_ptr; | ||
21 | 39 | char errmsg[STRERROR_MAX]; | 40 | char errmsg[STRERROR_MAX]; |
22 | 40 | errmsg[0]= 0; | 41 | errmsg[0]= 0; |
23 | 42 | |||
24 | 43 | #ifdef STRERROR_R_CHAR_P | ||
25 | 44 | errmsg_ptr= strerror_r(errno, errmsg, sizeof(errmsg)); | ||
26 | 45 | #else | ||
27 | 41 | strerror_r(errno, errmsg, sizeof(errmsg)); | 46 | strerror_r(errno, errmsg, sizeof(errmsg)); |
28 | 47 | errmsg_ptr= errmsg; | ||
29 | 48 | #endif | ||
30 | 49 | |||
31 | 42 | errmsg_printf(error::ERROR, "%s: %s\n", message, errmsg); | 50 | errmsg_printf(error::ERROR, "%s: %s\n", message, errmsg); |
32 | 51 | |||
33 | 43 | } | 52 | } |
34 | 44 | 53 | ||
35 | 45 | // @todo Cap the size of message. | 54 | // @todo Cap the size of message. |
36 | @@ -52,9 +61,16 @@ | |||
37 | 52 | // @todo Cap the size of message/extra. | 61 | // @todo Cap the size of message/extra. |
38 | 53 | void sql_perror(std::string message, const std::string &extra) | 62 | void sql_perror(std::string message, const std::string &extra) |
39 | 54 | { | 63 | { |
40 | 64 | char *errmsg_ptr; | ||
41 | 55 | char errmsg[STRERROR_MAX]; | 65 | char errmsg[STRERROR_MAX]; |
42 | 56 | errmsg[0]= 0; | 66 | errmsg[0]= 0; |
43 | 67 | |||
44 | 68 | #ifdef STRERROR_R_CHAR_P | ||
45 | 69 | errmsg_ptr= strerror_r(errno, errmsg, sizeof(errmsg)); | ||
46 | 70 | #else | ||
47 | 57 | strerror_r(errno, errmsg, sizeof(errmsg)); | 71 | strerror_r(errno, errmsg, sizeof(errmsg)); |
48 | 72 | errmsg_ptr= errmsg; | ||
49 | 73 | #endif | ||
50 | 58 | 74 | ||
51 | 59 | if (not extra.empty()) | 75 | if (not extra.empty()) |
52 | 60 | { | 76 | { |
53 | 61 | 77 | ||
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 | 746 | return 0; | 746 | return 0; |
59 | 747 | } | 747 | } |
60 | 748 | 748 | ||
62 | 749 | bool Field::is_null(ptrdiff_t row_offset) | 749 | bool Field::is_null(ptrdiff_t row_offset) const |
63 | 750 | { | 750 | { |
64 | 751 | return null_ptr ? | 751 | return null_ptr ? |
65 | 752 | (null_ptr[row_offset] & null_bit ? true : false) : | 752 | (null_ptr[row_offset] & null_bit ? true : false) : |
66 | 753 | table->null_row; | 753 | table->null_row; |
67 | 754 | } | 754 | } |
68 | 755 | 755 | ||
70 | 756 | bool Field::is_real_null(ptrdiff_t row_offset) | 756 | bool Field::is_real_null(ptrdiff_t row_offset) const |
71 | 757 | { | 757 | { |
72 | 758 | return null_ptr ? (null_ptr[row_offset] & null_bit ? true : false) : false; | 758 | return null_ptr ? (null_ptr[row_offset] & null_bit ? true : false) : false; |
73 | 759 | } | 759 | } |
74 | 760 | 760 | ||
76 | 761 | bool Field::is_null_in_record(const unsigned char *record) | 761 | bool Field::is_null_in_record(const unsigned char *record) const |
77 | 762 | { | 762 | { |
78 | 763 | if (! null_ptr) | 763 | if (! null_ptr) |
79 | 764 | return false; | 764 | return false; |
80 | 765 | return test(record[(uint32_t) (null_ptr -table->getInsertRecord())] & null_bit); | 765 | return test(record[(uint32_t) (null_ptr -table->getInsertRecord())] & null_bit); |
81 | 766 | } | 766 | } |
82 | 767 | 767 | ||
84 | 768 | bool Field::is_null_in_record_with_offset(ptrdiff_t with_offset) | 768 | bool Field::is_null_in_record_with_offset(ptrdiff_t with_offset) const |
85 | 769 | { | 769 | { |
86 | 770 | if (! null_ptr) | 770 | if (! null_ptr) |
87 | 771 | return false; | 771 | return false; |
88 | @@ -784,12 +784,12 @@ | |||
89 | 784 | null_ptr[row_offset]&= (unsigned char) ~null_bit; | 784 | null_ptr[row_offset]&= (unsigned char) ~null_bit; |
90 | 785 | } | 785 | } |
91 | 786 | 786 | ||
93 | 787 | bool Field::maybe_null(void) | 787 | bool Field::maybe_null(void) const |
94 | 788 | { | 788 | { |
95 | 789 | return null_ptr != 0 || table->maybe_null; | 789 | return null_ptr != 0 || table->maybe_null; |
96 | 790 | } | 790 | } |
97 | 791 | 791 | ||
99 | 792 | bool Field::real_maybe_null(void) | 792 | bool Field::real_maybe_null(void) const |
100 | 793 | { | 793 | { |
101 | 794 | return null_ptr != 0; | 794 | return null_ptr != 0; |
102 | 795 | } | 795 | } |
103 | @@ -851,7 +851,7 @@ | |||
104 | 851 | { | 851 | { |
105 | 852 | } | 852 | } |
106 | 853 | 853 | ||
108 | 854 | void Field::hash(uint32_t *nr, uint32_t *nr2) | 854 | void Field::hash(uint32_t *nr, uint32_t *nr2) const |
109 | 855 | { | 855 | { |
110 | 856 | if (is_null()) | 856 | if (is_null()) |
111 | 857 | { | 857 | { |
112 | @@ -943,7 +943,7 @@ | |||
113 | 943 | return(result); | 943 | return(result); |
114 | 944 | } | 944 | } |
115 | 945 | 945 | ||
117 | 946 | type::Decimal *Field::val_decimal(type::Decimal *) | 946 | type::Decimal *Field::val_decimal(type::Decimal *) const |
118 | 947 | { | 947 | { |
119 | 948 | /* This never have to be called */ | 948 | /* This never have to be called */ |
120 | 949 | assert(0); | 949 | assert(0); |
121 | @@ -1012,14 +1012,14 @@ | |||
122 | 1012 | return copy->length+ store_length; | 1012 | return copy->length+ store_length; |
123 | 1013 | } | 1013 | } |
124 | 1014 | 1014 | ||
126 | 1015 | bool Field::get_date(type::Time <ime, uint32_t fuzzydate) | 1015 | bool Field::get_date(type::Time <ime, uint32_t fuzzydate) const |
127 | 1016 | { | 1016 | { |
128 | 1017 | char buff[type::Time::MAX_STRING_LENGTH]; | 1017 | char buff[type::Time::MAX_STRING_LENGTH]; |
129 | 1018 | String tmp(buff,sizeof(buff),&my_charset_bin),*res; | 1018 | String tmp(buff,sizeof(buff),&my_charset_bin),*res; |
130 | 1019 | 1019 | ||
131 | 1020 | assert(getTable() and getTable()->getSession()); | 1020 | assert(getTable() and getTable()->getSession()); |
132 | 1021 | 1021 | ||
134 | 1022 | if (not (res=val_str_internal(&tmp)) or | 1022 | if (not (res= val_str_internal(&tmp)) or |
135 | 1023 | str_to_datetime_with_warn(getTable()->getSession(), | 1023 | str_to_datetime_with_warn(getTable()->getSession(), |
136 | 1024 | res->ptr(), res->length(), | 1024 | res->ptr(), res->length(), |
137 | 1025 | <ime, fuzzydate) <= type::DRIZZLE_TIMESTAMP_ERROR) | 1025 | <ime, fuzzydate) <= type::DRIZZLE_TIMESTAMP_ERROR) |
138 | @@ -1030,7 +1030,7 @@ | |||
139 | 1030 | return false; | 1030 | return false; |
140 | 1031 | } | 1031 | } |
141 | 1032 | 1032 | ||
143 | 1033 | bool Field::get_time(type::Time <ime) | 1033 | bool Field::get_time(type::Time <ime) const |
144 | 1034 | { | 1034 | { |
145 | 1035 | char buff[type::Time::MAX_STRING_LENGTH]; | 1035 | char buff[type::Time::MAX_STRING_LENGTH]; |
146 | 1036 | String tmp(buff,sizeof(buff),&my_charset_bin),*res; | 1036 | String tmp(buff,sizeof(buff),&my_charset_bin),*res; |
147 | @@ -1253,7 +1253,7 @@ | |||
148 | 1253 | } | 1253 | } |
149 | 1254 | } | 1254 | } |
150 | 1255 | 1255 | ||
152 | 1256 | bool Field::isReadSet() | 1256 | bool Field::isReadSet() const |
153 | 1257 | { | 1257 | { |
154 | 1258 | return table->isReadSet(field_index); | 1258 | return table->isReadSet(field_index); |
155 | 1259 | } | 1259 | } |
156 | 1260 | 1260 | ||
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 | 217 | Needs to be changed if/when we want to support different time formats. | 217 | Needs to be changed if/when we want to support different time formats. |
162 | 218 | */ | 218 | */ |
163 | 219 | virtual int store_time(type::Time <ime, type::timestamp_t t_type); | 219 | virtual int store_time(type::Time <ime, type::timestamp_t t_type); |
168 | 220 | virtual double val_real()=0; | 220 | virtual double val_real() const=0; |
169 | 221 | virtual int64_t val_int()=0; | 221 | virtual int64_t val_int() const =0; |
170 | 222 | virtual type::Decimal *val_decimal(type::Decimal *); | 222 | virtual type::Decimal *val_decimal(type::Decimal *) const; |
171 | 223 | String *val_str_internal(String *str) | 223 | String *val_str_internal(String *str) const |
172 | 224 | { | 224 | { |
173 | 225 | return val_str(str, str); | 225 | return val_str(str, str); |
174 | 226 | } | 226 | } |
175 | @@ -237,7 +237,7 @@ | |||
176 | 237 | an unnecessary free (and later, may be an alloc). | 237 | an unnecessary free (and later, may be an alloc). |
177 | 238 | This trickery is used to decrease a number of malloc calls. | 238 | This trickery is used to decrease a number of malloc calls. |
178 | 239 | */ | 239 | */ |
180 | 240 | virtual String *val_str(String*, String *)=0; | 240 | virtual String *val_str(String*, String *) const =0; |
181 | 241 | 241 | ||
182 | 242 | /* | 242 | /* |
183 | 243 | str_needs_quotes() returns true if the value returned by val_str() needs | 243 | str_needs_quotes() returns true if the value returned by val_str() needs |
184 | @@ -363,14 +363,14 @@ | |||
185 | 363 | // For new field | 363 | // For new field |
186 | 364 | virtual uint32_t size_of() const =0; | 364 | virtual uint32_t size_of() const =0; |
187 | 365 | 365 | ||
192 | 366 | bool is_null(ptrdiff_t row_offset= 0); | 366 | bool is_null(ptrdiff_t row_offset= 0) const; |
193 | 367 | bool is_real_null(ptrdiff_t row_offset= 0); | 367 | bool is_real_null(ptrdiff_t row_offset= 0) const; |
194 | 368 | bool is_null_in_record(const unsigned char *record); | 368 | bool is_null_in_record(const unsigned char *record) const; |
195 | 369 | bool is_null_in_record_with_offset(ptrdiff_t offset); | 369 | bool is_null_in_record_with_offset(ptrdiff_t offset) const; |
196 | 370 | void set_null(ptrdiff_t row_offset= 0); | 370 | void set_null(ptrdiff_t row_offset= 0); |
197 | 371 | void set_notnull(ptrdiff_t row_offset= 0); | 371 | void set_notnull(ptrdiff_t row_offset= 0); |
200 | 372 | bool maybe_null(void); | 372 | bool maybe_null(void) const; |
201 | 373 | bool real_maybe_null(void); | 373 | bool real_maybe_null(void) const; |
202 | 374 | 374 | ||
203 | 375 | virtual void make_field(SendField *); | 375 | virtual void make_field(SendField *); |
204 | 376 | virtual void sort_string(unsigned char *buff,uint32_t length)=0; | 376 | virtual void sort_string(unsigned char *buff,uint32_t length)=0; |
205 | @@ -596,8 +596,8 @@ | |||
206 | 596 | } | 596 | } |
207 | 597 | void copy_from_tmp(int offset); | 597 | void copy_from_tmp(int offset); |
208 | 598 | uint32_t fill_cache_field(CacheField *copy); | 598 | uint32_t fill_cache_field(CacheField *copy); |
211 | 599 | virtual bool get_date(type::Time <ime,uint32_t fuzzydate); | 599 | virtual bool get_date(type::Time <ime,uint32_t fuzzydate) const; |
212 | 600 | virtual bool get_time(type::Time <ime); | 600 | virtual bool get_time(type::Time <ime) const; |
213 | 601 | virtual const CHARSET_INFO *charset(void) const { return &my_charset_bin; } | 601 | virtual const CHARSET_INFO *charset(void) const { return &my_charset_bin; } |
214 | 602 | virtual const CHARSET_INFO *sort_charset(void) const { return charset(); } | 602 | virtual const CHARSET_INFO *sort_charset(void) const { return charset(); } |
215 | 603 | virtual bool has_charset(void) const { return false; } | 603 | virtual bool has_charset(void) const { return false; } |
216 | @@ -738,7 +738,7 @@ | |||
217 | 738 | } | 738 | } |
218 | 739 | 739 | ||
219 | 740 | /* Hash value */ | 740 | /* Hash value */ |
221 | 741 | virtual void hash(uint32_t *nr, uint32_t *nr2); | 741 | virtual void hash(uint32_t *nr, uint32_t *nr2) const; |
222 | 742 | friend bool reopen_table(Session *,Table *,bool); | 742 | friend bool reopen_table(Session *,Table *,bool); |
223 | 743 | 743 | ||
224 | 744 | friend class CopyField; | 744 | friend class CopyField; |
225 | @@ -754,7 +754,7 @@ | |||
226 | 754 | friend class Item_sum_max; | 754 | friend class Item_sum_max; |
227 | 755 | friend class Item_func_group_concat; | 755 | friend class Item_func_group_concat; |
228 | 756 | 756 | ||
230 | 757 | bool isReadSet(); | 757 | bool isReadSet() const; |
231 | 758 | bool isWriteSet(); | 758 | bool isWriteSet(); |
232 | 759 | void setReadSet(bool arg= true); | 759 | void setReadSet(bool arg= true); |
233 | 760 | void setWriteSet(bool arg= true); | 760 | void setWriteSet(bool arg= true); |
234 | 761 | 761 | ||
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 | 90 | 90 | ||
240 | 91 | 91 | ||
241 | 92 | uint32_t Field_blob::get_length(const unsigned char *pos, | 92 | uint32_t Field_blob::get_length(const unsigned char *pos, |
243 | 93 | bool low_byte_first) | 93 | bool low_byte_first) const |
244 | 94 | { | 94 | { |
245 | 95 | #ifndef WORDS_BIGENDIAN | 95 | #ifndef WORDS_BIGENDIAN |
246 | 96 | (void)low_byte_first; | 96 | (void)low_byte_first; |
247 | @@ -113,14 +113,14 @@ | |||
248 | 113 | } | 113 | } |
249 | 114 | 114 | ||
250 | 115 | 115 | ||
252 | 116 | uint32_t Field_blob::get_length(uint32_t row_offset) | 116 | uint32_t Field_blob::get_length(uint32_t row_offset) const |
253 | 117 | { | 117 | { |
254 | 118 | return get_length(ptr+row_offset, | 118 | return get_length(ptr+row_offset, |
255 | 119 | getTable()->getShare()->db_low_byte_first); | 119 | getTable()->getShare()->db_low_byte_first); |
256 | 120 | } | 120 | } |
257 | 121 | 121 | ||
258 | 122 | 122 | ||
260 | 123 | uint32_t Field_blob::get_length(const unsigned char *ptr_arg) | 123 | uint32_t Field_blob::get_length(const unsigned char *ptr_arg) const |
261 | 124 | { | 124 | { |
262 | 125 | return get_length(ptr_arg, getTable()->getShare()->db_low_byte_first); | 125 | return get_length(ptr_arg, getTable()->getShare()->db_low_byte_first); |
263 | 126 | } | 126 | } |
264 | @@ -224,7 +224,7 @@ | |||
265 | 224 | } | 224 | } |
266 | 225 | 225 | ||
267 | 226 | 226 | ||
269 | 227 | double Field_blob::val_real(void) | 227 | double Field_blob::val_real(void) const |
270 | 228 | { | 228 | { |
271 | 229 | int not_used; | 229 | int not_used; |
272 | 230 | char *end_not_used, *blob; | 230 | char *end_not_used, *blob; |
273 | @@ -242,7 +242,7 @@ | |||
274 | 242 | } | 242 | } |
275 | 243 | 243 | ||
276 | 244 | 244 | ||
278 | 245 | int64_t Field_blob::val_int(void) | 245 | int64_t Field_blob::val_int(void) const |
279 | 246 | { | 246 | { |
280 | 247 | int not_used; | 247 | int not_used; |
281 | 248 | char *blob; | 248 | char *blob; |
282 | @@ -252,12 +252,11 @@ | |||
283 | 252 | memcpy(&blob,ptr+sizeof(uint32_t),sizeof(char*)); | 252 | memcpy(&blob,ptr+sizeof(uint32_t),sizeof(char*)); |
284 | 253 | if (!blob) | 253 | if (!blob) |
285 | 254 | return 0; | 254 | return 0; |
287 | 255 | uint32_t length=get_length(ptr); | 255 | uint32_t length= get_length(ptr); |
288 | 256 | return my_strntoll(charset(),blob,length,10,NULL,¬_used); | 256 | return my_strntoll(charset(),blob,length,10,NULL,¬_used); |
289 | 257 | } | 257 | } |
290 | 258 | 258 | ||
293 | 259 | String *Field_blob::val_str(String *, | 259 | String *Field_blob::val_str(String *, String *val_ptr) const |
292 | 260 | String *val_ptr) | ||
294 | 261 | { | 260 | { |
295 | 262 | char *blob; | 261 | char *blob; |
296 | 263 | 262 | ||
297 | @@ -272,7 +271,7 @@ | |||
298 | 272 | } | 271 | } |
299 | 273 | 272 | ||
300 | 274 | 273 | ||
302 | 275 | type::Decimal *Field_blob::val_decimal(type::Decimal *decimal_value) | 274 | type::Decimal *Field_blob::val_decimal(type::Decimal *decimal_value) const |
303 | 276 | { | 275 | { |
304 | 277 | const char *blob; | 276 | const char *blob; |
305 | 278 | size_t length; | 277 | size_t length; |
306 | 279 | 278 | ||
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 | 77 | int store(double nr); | 77 | int store(double nr); |
312 | 78 | int store(int64_t nr, bool unsigned_val); | 78 | int store(int64_t nr, bool unsigned_val); |
313 | 79 | 79 | ||
318 | 80 | double val_real(void); | 80 | double val_real(void) const; |
319 | 81 | int64_t val_int(void); | 81 | int64_t val_int(void) const; |
320 | 82 | String *val_str(String*,String *); | 82 | String *val_str(String*,String *) const; |
321 | 83 | type::Decimal *val_decimal(type::Decimal *); | 83 | type::Decimal *val_decimal(type::Decimal *) const; |
322 | 84 | int cmp_max(const unsigned char *, const unsigned char *, uint32_t max_length); | 84 | int cmp_max(const unsigned char *, const unsigned char *, uint32_t max_length); |
323 | 85 | int cmp(const unsigned char *a,const unsigned char *b) | 85 | int cmp(const unsigned char *a,const unsigned char *b) |
324 | 86 | { return cmp_max(a, b, UINT32_MAX); } | 86 | { return cmp_max(a, b, UINT32_MAX); } |
325 | @@ -132,9 +132,9 @@ | |||
326 | 132 | */ | 132 | */ |
327 | 133 | uint32_t get_packed_size(const unsigned char *ptr_arg, bool low_byte_first); | 133 | uint32_t get_packed_size(const unsigned char *ptr_arg, bool low_byte_first); |
328 | 134 | 134 | ||
332 | 135 | DRIZZLED_API uint32_t get_length(uint32_t row_offset= 0); | 135 | DRIZZLED_API uint32_t get_length(uint32_t row_offset= 0) const; |
333 | 136 | DRIZZLED_API uint32_t get_length(const unsigned char *ptr, bool low_byte_first); | 136 | DRIZZLED_API uint32_t get_length(const unsigned char *ptr, bool low_byte_first) const; |
334 | 137 | DRIZZLED_API uint32_t get_length(const unsigned char *ptr_arg); | 137 | DRIZZLED_API uint32_t get_length(const unsigned char *ptr_arg) const; |
335 | 138 | void put_length(unsigned char *pos, uint32_t length); | 138 | void put_length(unsigned char *pos, uint32_t length); |
336 | 139 | inline void get_ptr(unsigned char **str) | 139 | inline void get_ptr(unsigned char **str) |
337 | 140 | { | 140 | { |
338 | 141 | 141 | ||
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 | 123 | res.set_ascii(STRING_WITH_LEN("boolean")); | 123 | res.set_ascii(STRING_WITH_LEN("boolean")); |
344 | 124 | } | 124 | } |
345 | 125 | 125 | ||
359 | 126 | double Boolean::val_real() | 126 | double Boolean::val_real() const |
360 | 127 | { | 127 | { |
361 | 128 | ASSERT_COLUMN_MARKED_FOR_READ; | 128 | ASSERT_COLUMN_MARKED_FOR_READ; |
362 | 129 | return isTrue(); | 129 | return isTrue(); |
363 | 130 | } | 130 | } |
364 | 131 | 131 | ||
365 | 132 | int64_t Boolean::val_int() | 132 | int64_t Boolean::val_int() const |
366 | 133 | { | 133 | { |
367 | 134 | ASSERT_COLUMN_MARKED_FOR_READ; | 134 | ASSERT_COLUMN_MARKED_FOR_READ; |
368 | 135 | return isTrue(); | 135 | return isTrue(); |
369 | 136 | } | 136 | } |
370 | 137 | 137 | ||
371 | 138 | String *Boolean::val_str(String *val_buffer, String *) | 138 | String *Boolean::val_str(String *val_buffer, String *) const |
372 | 139 | { | 139 | { |
373 | 140 | ASSERT_COLUMN_MARKED_FOR_READ; | 140 | ASSERT_COLUMN_MARKED_FOR_READ; |
374 | 141 | 141 | ||
375 | @@ -144,7 +144,7 @@ | |||
376 | 144 | return val_buffer; | 144 | return val_buffer; |
377 | 145 | } | 145 | } |
378 | 146 | 146 | ||
380 | 147 | type::Decimal *Boolean::val_decimal(type::Decimal *dec) | 147 | type::Decimal *Boolean::val_decimal(type::Decimal *dec) const |
381 | 148 | { | 148 | { |
382 | 149 | if (isTrue()) | 149 | if (isTrue()) |
383 | 150 | { | 150 | { |
384 | 151 | 151 | ||
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 | 52 | int store(int64_t nr, bool unsigned_val); | 52 | int store(int64_t nr, bool unsigned_val); |
390 | 53 | int store_decimal(const drizzled::type::Decimal*); | 53 | int store_decimal(const drizzled::type::Decimal*); |
391 | 54 | 54 | ||
396 | 55 | String *val_str(String*,String *); | 55 | String *val_str(String*,String *) const; |
397 | 56 | double val_real(); | 56 | double val_real() const; |
398 | 57 | int64_t val_int(); | 57 | int64_t val_int() const; |
399 | 58 | type::Decimal *val_decimal(type::Decimal *); | 58 | type::Decimal *val_decimal(type::Decimal *) const; |
400 | 59 | 59 | ||
401 | 60 | void sql_type(drizzled::String&) const; | 60 | void sql_type(drizzled::String&) const; |
402 | 61 | 61 | ||
403 | 62 | 62 | ||
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 | 173 | return error; | 173 | return error; |
409 | 174 | } | 174 | } |
410 | 175 | 175 | ||
412 | 176 | double Field_date::val_real(void) | 176 | double Field_date::val_real(void) const |
413 | 177 | { | 177 | { |
414 | 178 | return (double) Field_date::val_int(); | 178 | return (double) Field_date::val_int(); |
415 | 179 | } | 179 | } |
416 | 180 | 180 | ||
418 | 181 | int64_t Field_date::val_int(void) | 181 | int64_t Field_date::val_int(void) const |
419 | 182 | { | 182 | { |
420 | 183 | uint32_t j; | 183 | uint32_t j; |
421 | 184 | 184 | ||
422 | @@ -189,7 +189,7 @@ | |||
423 | 189 | return (int64_t) j; | 189 | return (int64_t) j; |
424 | 190 | } | 190 | } |
425 | 191 | 191 | ||
427 | 192 | String *Field_date::val_str(String *val_buffer, String *) | 192 | String *Field_date::val_str(String *val_buffer, String *) const |
428 | 193 | { | 193 | { |
429 | 194 | val_buffer->alloc(field_length); | 194 | val_buffer->alloc(field_length); |
430 | 195 | val_buffer->length(field_length); | 195 | val_buffer->length(field_length); |
431 | @@ -217,7 +217,7 @@ | |||
432 | 217 | return val_buffer; | 217 | return val_buffer; |
433 | 218 | } | 218 | } |
434 | 219 | 219 | ||
436 | 220 | bool Field_date::get_date(type::Time <ime, uint32_t fuzzydate) | 220 | bool Field_date::get_date(type::Time <ime, uint32_t fuzzydate) const |
437 | 221 | { | 221 | { |
438 | 222 | uint32_t tmp=(uint32_t) uint4korr(ptr); | 222 | uint32_t tmp=(uint32_t) uint4korr(ptr); |
439 | 223 | ltime.day= (int) (tmp%100); | 223 | ltime.day= (int) (tmp%100); |
440 | @@ -230,7 +230,7 @@ | |||
441 | 230 | 1 : 0); | 230 | 1 : 0); |
442 | 231 | } | 231 | } |
443 | 232 | 232 | ||
445 | 233 | bool Field_date::get_time(type::Time <ime) | 233 | bool Field_date::get_time(type::Time <ime) const |
446 | 234 | { | 234 | { |
447 | 235 | return Field_date::get_date(ltime ,0); | 235 | return Field_date::get_date(ltime ,0); |
448 | 236 | } | 236 | } |
449 | 237 | 237 | ||
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 | 66 | int store(int64_t nr, bool unsigned_val); | 66 | int store(int64_t nr, bool unsigned_val); |
455 | 67 | int store_time(type::Time <ime, type::timestamp_t type); | 67 | int store_time(type::Time <ime, type::timestamp_t type); |
456 | 68 | int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; } | 68 | int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; } |
460 | 69 | double val_real(void); | 69 | double val_real(void) const; |
461 | 70 | int64_t val_int(void); | 70 | int64_t val_int(void) const; |
462 | 71 | String *val_str(String*,String *); | 71 | String *val_str(String*,String *) const; |
463 | 72 | int cmp(const unsigned char *,const unsigned char *); | 72 | int cmp(const unsigned char *,const unsigned char *); |
464 | 73 | void sort_string(unsigned char *buff,uint32_t length); | 73 | void sort_string(unsigned char *buff,uint32_t length); |
465 | 74 | uint32_t pack_length() const { return 4; } | 74 | uint32_t pack_length() const { return 4; } |
466 | 75 | void sql_type(String &str) const; | 75 | void sql_type(String &str) const; |
467 | 76 | bool can_be_compared_as_int64_t() const { return true; } | 76 | bool can_be_compared_as_int64_t() const { return true; } |
468 | 77 | bool zero_pack() const { return 1; } | 77 | bool zero_pack() const { return 1; } |
471 | 78 | bool get_date(type::Time <ime,uint32_t fuzzydate); | 78 | bool get_date(type::Time <ime,uint32_t fuzzydate) const; |
472 | 79 | bool get_time(type::Time <ime); | 79 | bool get_time(type::Time <ime) const; |
473 | 80 | }; | 80 | }; |
474 | 81 | 81 | ||
475 | 82 | } /* namespace drizzled */ | 82 | } /* namespace drizzled */ |
476 | 83 | 83 | ||
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 | 158 | return 0; | 158 | return 0; |
482 | 159 | } | 159 | } |
483 | 160 | 160 | ||
485 | 161 | double Field_datetime::val_real(void) | 161 | double Field_datetime::val_real(void) const |
486 | 162 | { | 162 | { |
487 | 163 | return (double) Field_datetime::val_int(); | 163 | return (double) Field_datetime::val_int(); |
488 | 164 | } | 164 | } |
489 | 165 | 165 | ||
491 | 166 | int64_t Field_datetime::val_int(void) | 166 | int64_t Field_datetime::val_int(void) const |
492 | 167 | { | 167 | { |
493 | 168 | int64_t j; | 168 | int64_t j; |
494 | 169 | 169 | ||
495 | @@ -179,8 +179,7 @@ | |||
496 | 179 | } | 179 | } |
497 | 180 | 180 | ||
498 | 181 | 181 | ||
501 | 182 | String *Field_datetime::val_str(String *val_buffer, | 182 | String *Field_datetime::val_str(String *val_buffer, String *) const |
500 | 183 | String *) | ||
502 | 184 | { | 183 | { |
503 | 185 | val_buffer->alloc(DateTime::MAX_STRING_LENGTH); | 184 | val_buffer->alloc(DateTime::MAX_STRING_LENGTH); |
504 | 186 | val_buffer->length(DateTime::MAX_STRING_LENGTH); | 185 | val_buffer->length(DateTime::MAX_STRING_LENGTH); |
505 | @@ -217,7 +216,7 @@ | |||
506 | 217 | return val_buffer; | 216 | return val_buffer; |
507 | 218 | } | 217 | } |
508 | 219 | 218 | ||
510 | 220 | bool Field_datetime::get_date(type::Time <ime, uint32_t fuzzydate) | 219 | bool Field_datetime::get_date(type::Time <ime, uint32_t fuzzydate) const |
511 | 221 | { | 220 | { |
512 | 222 | int64_t tmp=Field_datetime::val_int(); | 221 | int64_t tmp=Field_datetime::val_int(); |
513 | 223 | uint32_t part1,part2; | 222 | uint32_t part1,part2; |
514 | @@ -237,7 +236,7 @@ | |||
515 | 237 | return (!(fuzzydate & TIME_FUZZY_DATE) && (!ltime.month || !ltime.day)) ? 1 : 0; | 236 | return (!(fuzzydate & TIME_FUZZY_DATE) && (!ltime.month || !ltime.day)) ? 1 : 0; |
516 | 238 | } | 237 | } |
517 | 239 | 238 | ||
519 | 240 | bool Field_datetime::get_time(type::Time <ime) | 239 | bool Field_datetime::get_time(type::Time <ime) const |
520 | 241 | { | 240 | { |
521 | 242 | return Field_datetime::get_date(ltime,0); | 241 | return Field_datetime::get_date(ltime,0); |
522 | 243 | } | 242 | } |
523 | 244 | 243 | ||
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 | 69 | ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0; | 69 | ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0; |
529 | 70 | return 0; | 70 | return 0; |
530 | 71 | } | 71 | } |
534 | 72 | double val_real(void); | 72 | double val_real(void) const; |
535 | 73 | int64_t val_int(void); | 73 | int64_t val_int(void) const; |
536 | 74 | String *val_str(String*,String *); | 74 | String *val_str(String*,String *) const; |
537 | 75 | int cmp(const unsigned char *,const unsigned char *); | 75 | int cmp(const unsigned char *,const unsigned char *); |
538 | 76 | void sort_string(unsigned char *buff,uint32_t length); | 76 | void sort_string(unsigned char *buff,uint32_t length); |
539 | 77 | uint32_t pack_length() const { return 8; } | 77 | uint32_t pack_length() const { return 8; } |
540 | 78 | void sql_type(String &str) const; | 78 | void sql_type(String &str) const; |
541 | 79 | bool can_be_compared_as_int64_t() const { return true; } | 79 | bool can_be_compared_as_int64_t() const { return true; } |
542 | 80 | bool zero_pack() const { return 1; } | 80 | bool zero_pack() const { return 1; } |
545 | 81 | bool get_date(type::Time <ime,uint32_t fuzzydate); | 81 | bool get_date(type::Time <ime,uint32_t fuzzydate) const; |
546 | 82 | bool get_time(type::Time <ime); | 82 | bool get_time(type::Time <ime) const; |
547 | 83 | }; | 83 | }; |
548 | 84 | 84 | ||
549 | 85 | } /* namespace drizzled */ | 85 | } /* namespace drizzled */ |
550 | 86 | 86 | ||
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 | 260 | } | 260 | } |
556 | 261 | 261 | ||
557 | 262 | 262 | ||
559 | 263 | double Field_decimal::val_real(void) | 263 | double Field_decimal::val_real(void) const |
560 | 264 | { | 264 | { |
561 | 265 | double dbl; | 265 | double dbl; |
562 | 266 | type::Decimal decimal_value; | 266 | type::Decimal decimal_value; |
563 | @@ -273,7 +273,7 @@ | |||
564 | 273 | } | 273 | } |
565 | 274 | 274 | ||
566 | 275 | 275 | ||
568 | 276 | int64_t Field_decimal::val_int(void) | 276 | int64_t Field_decimal::val_int(void) const |
569 | 277 | { | 277 | { |
570 | 278 | int64_t i; | 278 | int64_t i; |
571 | 279 | type::Decimal decimal_value; | 279 | type::Decimal decimal_value; |
572 | @@ -286,7 +286,7 @@ | |||
573 | 286 | } | 286 | } |
574 | 287 | 287 | ||
575 | 288 | 288 | ||
577 | 289 | type::Decimal* Field_decimal::val_decimal(type::Decimal *decimal_value) | 289 | type::Decimal* Field_decimal::val_decimal(type::Decimal *decimal_value) const |
578 | 290 | { | 290 | { |
579 | 291 | ASSERT_COLUMN_MARKED_FOR_READ; | 291 | ASSERT_COLUMN_MARKED_FOR_READ; |
580 | 292 | 292 | ||
581 | @@ -296,8 +296,7 @@ | |||
582 | 296 | } | 296 | } |
583 | 297 | 297 | ||
584 | 298 | 298 | ||
587 | 299 | String *Field_decimal::val_str(String *val_buffer, | 299 | String *Field_decimal::val_str(String *val_buffer, String *) const |
586 | 300 | String *) | ||
588 | 301 | { | 300 | { |
589 | 302 | type::Decimal decimal_value; | 301 | type::Decimal decimal_value; |
590 | 303 | 302 | ||
591 | 304 | 303 | ||
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 | 70 | int store(int64_t nr, bool unsigned_val); | 70 | int store(int64_t nr, bool unsigned_val); |
597 | 71 | int store_time(type::Time <ime, type::timestamp_t t_type); | 71 | int store_time(type::Time <ime, type::timestamp_t t_type); |
598 | 72 | int store_decimal(const type::Decimal *); | 72 | int store_decimal(const type::Decimal *); |
603 | 73 | double val_real(void); | 73 | double val_real(void) const; |
604 | 74 | int64_t val_int(void); | 74 | int64_t val_int(void) const; |
605 | 75 | type::Decimal *val_decimal(type::Decimal *); | 75 | type::Decimal *val_decimal(type::Decimal *) const; |
606 | 76 | String *val_str(String*, String *); | 76 | String *val_str(String*, String *) const; |
607 | 77 | int cmp(const unsigned char *, const unsigned char *); | 77 | int cmp(const unsigned char *, const unsigned char *); |
608 | 78 | void sort_string(unsigned char *buff, uint32_t length); | 78 | void sort_string(unsigned char *buff, uint32_t length); |
609 | 79 | bool zero_pack() const { return 0; } | 79 | bool zero_pack() const { return 0; } |
610 | 80 | 80 | ||
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 | 84 | (double) nr); | 84 | (double) nr); |
616 | 85 | } | 85 | } |
617 | 86 | 86 | ||
619 | 87 | double Field_double::val_real(void) | 87 | double Field_double::val_real(void) const |
620 | 88 | { | 88 | { |
621 | 89 | double j; | 89 | double j; |
622 | 90 | 90 | ||
623 | @@ -101,7 +101,7 @@ | |||
624 | 101 | return j; | 101 | return j; |
625 | 102 | } | 102 | } |
626 | 103 | 103 | ||
628 | 104 | int64_t Field_double::val_int(void) | 104 | int64_t Field_double::val_int(void) const |
629 | 105 | { | 105 | { |
630 | 106 | double j; | 106 | double j; |
631 | 107 | int64_t res; | 107 | int64_t res; |
632 | @@ -144,8 +144,7 @@ | |||
633 | 144 | } | 144 | } |
634 | 145 | 145 | ||
635 | 146 | 146 | ||
638 | 147 | String *Field_double::val_str(String *val_buffer, | 147 | String *Field_double::val_str(String *val_buffer, String *) const |
637 | 148 | String *) | ||
639 | 149 | { | 148 | { |
640 | 150 | double nr; | 149 | double nr; |
641 | 151 | 150 | ||
642 | 152 | 151 | ||
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 | 59 | int store(double nr); | 59 | int store(double nr); |
648 | 60 | int store(int64_t nr, bool unsigned_val); | 60 | int store(int64_t nr, bool unsigned_val); |
649 | 61 | int reset(void) { memset(ptr, 0, sizeof(double)); return 0; } | 61 | int reset(void) { memset(ptr, 0, sizeof(double)); return 0; } |
653 | 62 | double val_real(void); | 62 | double val_real(void) const; |
654 | 63 | int64_t val_int(void); | 63 | int64_t val_int(void) const; |
655 | 64 | String *val_str(String*,String *); | 64 | String *val_str(String*,String *) const; |
656 | 65 | int cmp(const unsigned char *,const unsigned char *); | 65 | int cmp(const unsigned char *,const unsigned char *); |
657 | 66 | void sort_string(unsigned char *buff,uint32_t length); | 66 | void sort_string(unsigned char *buff,uint32_t length); |
658 | 67 | uint32_t pack_length() const { return sizeof(double); } | 67 | uint32_t pack_length() const { return sizeof(double); } |
659 | 68 | 68 | ||
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 | 121 | return 0; | 121 | return 0; |
665 | 122 | } | 122 | } |
666 | 123 | 123 | ||
668 | 124 | double Field_enum::val_real(void) | 124 | double Field_enum::val_real(void) const |
669 | 125 | { | 125 | { |
670 | 126 | return (double) Field_enum::val_int(); | 126 | return (double) Field_enum::val_int(); |
671 | 127 | } | 127 | } |
672 | 128 | 128 | ||
674 | 129 | int64_t Field_enum::val_int(void) | 129 | int64_t Field_enum::val_int(void) const |
675 | 130 | { | 130 | { |
676 | 131 | ASSERT_COLUMN_MARKED_FOR_READ; | 131 | ASSERT_COLUMN_MARKED_FOR_READ; |
677 | 132 | 132 | ||
678 | @@ -140,7 +140,7 @@ | |||
679 | 140 | return ((int64_t) tmp) + 1; /* SQL is from 1, we store from 0 */ | 140 | return ((int64_t) tmp) + 1; /* SQL is from 1, we store from 0 */ |
680 | 141 | } | 141 | } |
681 | 142 | 142 | ||
683 | 143 | String *Field_enum::val_str(String *, String *val_ptr) | 143 | String *Field_enum::val_str(String *, String *val_ptr) const |
684 | 144 | { | 144 | { |
685 | 145 | uint32_t tmp=(uint32_t) Field_enum::val_int(); | 145 | uint32_t tmp=(uint32_t) Field_enum::val_int(); |
686 | 146 | 146 | ||
687 | 147 | 147 | ||
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 | 61 | int store(const char *to, uint32_t length, const CHARSET_INFO * const); | 61 | int store(const char *to, uint32_t length, const CHARSET_INFO * const); |
693 | 62 | int store(double nr); | 62 | int store(double nr); |
694 | 63 | int store(int64_t nr, bool unsigned_val); | 63 | int store(int64_t nr, bool unsigned_val); |
698 | 64 | double val_real(void); | 64 | double val_real(void) const; |
699 | 65 | int64_t val_int(void); | 65 | int64_t val_int(void) const; |
700 | 66 | String *val_str(String*, String *); | 66 | String *val_str(String*, String *) const; |
701 | 67 | int cmp(const unsigned char *, const unsigned char *); | 67 | int cmp(const unsigned char *, const unsigned char *); |
702 | 68 | void sort_string(unsigned char *buff, uint32_t length); | 68 | void sort_string(unsigned char *buff, uint32_t length); |
703 | 69 | void store_type(uint64_t value); | 69 | void store_type(uint64_t value); |
704 | 70 | 70 | ||
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 | 236 | return 0; | 236 | return 0; |
710 | 237 | } | 237 | } |
711 | 238 | 238 | ||
713 | 239 | double Epoch::val_real(void) | 239 | double Epoch::val_real(void) const |
714 | 240 | { | 240 | { |
715 | 241 | return (double) Epoch::val_int(); | 241 | return (double) Epoch::val_int(); |
716 | 242 | } | 242 | } |
717 | 243 | 243 | ||
719 | 244 | int64_t Epoch::val_int(void) | 244 | int64_t Epoch::val_int(void) const |
720 | 245 | { | 245 | { |
721 | 246 | uint64_t temp; | 246 | uint64_t temp; |
722 | 247 | 247 | ||
723 | @@ -258,7 +258,7 @@ | |||
724 | 258 | return result; | 258 | return result; |
725 | 259 | } | 259 | } |
726 | 260 | 260 | ||
728 | 261 | String *Epoch::val_str(String *val_buffer, String *) | 261 | String *Epoch::val_str(String *val_buffer, String *) const |
729 | 262 | { | 262 | { |
730 | 263 | uint64_t temp= 0; | 263 | uint64_t temp= 0; |
731 | 264 | char *to; | 264 | char *to; |
732 | @@ -282,7 +282,7 @@ | |||
733 | 282 | return val_buffer; | 282 | return val_buffer; |
734 | 283 | } | 283 | } |
735 | 284 | 284 | ||
737 | 285 | bool Epoch::get_date(type::Time <ime, uint32_t) | 285 | bool Epoch::get_date(type::Time <ime, uint32_t) const |
738 | 286 | { | 286 | { |
739 | 287 | uint64_t temp; | 287 | uint64_t temp; |
740 | 288 | type::Time::epoch_t time_temp; | 288 | type::Time::epoch_t time_temp; |
741 | @@ -297,7 +297,7 @@ | |||
742 | 297 | return 0; | 297 | return 0; |
743 | 298 | } | 298 | } |
744 | 299 | 299 | ||
746 | 300 | bool Epoch::get_time(type::Time <ime) | 300 | bool Epoch::get_time(type::Time <ime) const |
747 | 301 | { | 301 | { |
748 | 302 | return Epoch::get_date(ltime, 0); | 302 | return Epoch::get_date(ltime, 0); |
749 | 303 | } | 303 | } |
750 | @@ -368,7 +368,7 @@ | |||
751 | 368 | } | 368 | } |
752 | 369 | } | 369 | } |
753 | 370 | 370 | ||
755 | 371 | long Epoch::get_timestamp(bool *null_value) | 371 | long Epoch::get_timestamp(bool *null_value) const |
756 | 372 | { | 372 | { |
757 | 373 | if ((*null_value= is_null())) | 373 | if ((*null_value= is_null())) |
758 | 374 | return 0; | 374 | return 0; |
759 | 375 | 375 | ||
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 | 58 | int store_decimal(const type::Decimal *value); | 58 | int store_decimal(const type::Decimal *value); |
765 | 59 | 59 | ||
766 | 60 | int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0; return 0; } | 60 | int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0; return 0; } |
770 | 61 | double val_real(void); | 61 | double val_real(void) const; |
771 | 62 | int64_t val_int(void); | 62 | int64_t val_int(void) const; |
772 | 63 | String *val_str(String*,String *); | 63 | String *val_str(String*,String *) const; |
773 | 64 | int cmp(const unsigned char *,const unsigned char *); | 64 | int cmp(const unsigned char *,const unsigned char *); |
774 | 65 | void sort_string(unsigned char *buff,uint32_t length); | 65 | void sort_string(unsigned char *buff,uint32_t length); |
775 | 66 | uint32_t pack_length() const { return 8; } | 66 | uint32_t pack_length() const { return 8; } |
776 | @@ -71,7 +71,7 @@ | |||
777 | 71 | virtual void set_default(); | 71 | virtual void set_default(); |
778 | 72 | 72 | ||
779 | 73 | /* Get TIMESTAMP field value as seconds since begging of Unix Epoch */ | 73 | /* Get TIMESTAMP field value as seconds since begging of Unix Epoch */ |
781 | 74 | virtual long get_timestamp(bool *null_value); | 74 | virtual long get_timestamp(bool *null_value) const; |
782 | 75 | 75 | ||
783 | 76 | virtual bool is_timestamp() const | 76 | virtual bool is_timestamp() const |
784 | 77 | { | 77 | { |
785 | @@ -79,8 +79,8 @@ | |||
786 | 79 | } | 79 | } |
787 | 80 | 80 | ||
788 | 81 | private: | 81 | private: |
791 | 82 | bool get_date(type::Time <ime,uint32_t fuzzydate); | 82 | bool get_date(type::Time <ime,uint32_t fuzzydate) const; |
792 | 83 | bool get_time(type::Time <ime); | 83 | bool get_time(type::Time <ime) const; |
793 | 84 | 84 | ||
794 | 85 | public: | 85 | public: |
795 | 86 | virtual timestamp_auto_set_type get_auto_set_type() const; | 86 | virtual timestamp_auto_set_type get_auto_set_type() const; |
796 | 87 | 87 | ||
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 | 121 | } | 121 | } |
802 | 122 | 122 | ||
803 | 123 | 123 | ||
805 | 124 | double Int32::val_real(void) | 124 | double Int32::val_real(void) const |
806 | 125 | { | 125 | { |
807 | 126 | int32_t j; | 126 | int32_t j; |
808 | 127 | 127 | ||
809 | @@ -132,7 +132,7 @@ | |||
810 | 132 | return (double) j; | 132 | return (double) j; |
811 | 133 | } | 133 | } |
812 | 134 | 134 | ||
814 | 135 | int64_t Int32::val_int(void) | 135 | int64_t Int32::val_int(void) const |
815 | 136 | { | 136 | { |
816 | 137 | int32_t j; | 137 | int32_t j; |
817 | 138 | 138 | ||
818 | @@ -143,7 +143,7 @@ | |||
819 | 143 | return (int64_t) j; | 143 | return (int64_t) j; |
820 | 144 | } | 144 | } |
821 | 145 | 145 | ||
823 | 146 | String *Int32::val_str(String *val_buffer, String *) | 146 | String *Int32::val_str(String *val_buffer, String *) const |
824 | 147 | { | 147 | { |
825 | 148 | const CHARSET_INFO * const cs= &my_charset_bin; | 148 | const CHARSET_INFO * const cs= &my_charset_bin; |
826 | 149 | uint32_t length; | 149 | uint32_t length; |
827 | 150 | 150 | ||
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 | 62 | int store(double nr); | 62 | int store(double nr); |
833 | 63 | int store(int64_t nr, bool unsigned_val); | 63 | int store(int64_t nr, bool unsigned_val); |
834 | 64 | int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; } | 64 | int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; } |
838 | 65 | double val_real(void); | 65 | double val_real(void) const; |
839 | 66 | int64_t val_int(void); | 66 | int64_t val_int(void) const; |
840 | 67 | String *val_str(String*,String *); | 67 | String *val_str(String*,String *) const; |
841 | 68 | int cmp(const unsigned char *,const unsigned char *); | 68 | int cmp(const unsigned char *,const unsigned char *); |
842 | 69 | void sort_string(unsigned char *buff,uint32_t length); | 69 | void sort_string(unsigned char *buff,uint32_t length); |
843 | 70 | uint32_t pack_length() const { return 4; } | 70 | uint32_t pack_length() const { return 4; } |
844 | 71 | 71 | ||
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 | 121 | } | 121 | } |
850 | 122 | 122 | ||
851 | 123 | 123 | ||
853 | 124 | double Int64::val_real(void) | 124 | double Int64::val_real(void) const |
854 | 125 | { | 125 | { |
855 | 126 | int64_t j; | 126 | int64_t j; |
856 | 127 | 127 | ||
857 | @@ -134,7 +134,7 @@ | |||
858 | 134 | } | 134 | } |
859 | 135 | 135 | ||
860 | 136 | 136 | ||
862 | 137 | int64_t Int64::val_int(void) | 137 | int64_t Int64::val_int(void) const |
863 | 138 | { | 138 | { |
864 | 139 | int64_t j; | 139 | int64_t j; |
865 | 140 | 140 | ||
866 | @@ -146,7 +146,7 @@ | |||
867 | 146 | } | 146 | } |
868 | 147 | 147 | ||
869 | 148 | 148 | ||
871 | 149 | String *Int64::val_str(String *val_buffer, String *) | 149 | String *Int64::val_str(String *val_buffer, String *) const |
872 | 150 | { | 150 | { |
873 | 151 | const CHARSET_INFO * const cs= &my_charset_bin; | 151 | const CHARSET_INFO * const cs= &my_charset_bin; |
874 | 152 | uint32_t length; | 152 | uint32_t length; |
875 | 153 | 153 | ||
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 | 80 | ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0; | 80 | ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0; |
881 | 81 | return 0; | 81 | return 0; |
882 | 82 | } | 82 | } |
886 | 83 | double val_real(void); | 83 | double val_real(void) const; |
887 | 84 | int64_t val_int(void); | 84 | int64_t val_int(void) const; |
888 | 85 | String *val_str(String*,String *); | 85 | String *val_str(String*,String *) const; |
889 | 86 | int cmp(const unsigned char *,const unsigned char *); | 86 | int cmp(const unsigned char *,const unsigned char *); |
890 | 87 | void sort_string(unsigned char *buff,uint32_t length); | 87 | void sort_string(unsigned char *buff,uint32_t length); |
891 | 88 | uint32_t pack_length() const { return 8; } | 88 | uint32_t pack_length() const { return 8; } |
892 | 89 | 89 | ||
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 | 158 | return 0; | 158 | return 0; |
898 | 159 | } | 159 | } |
899 | 160 | 160 | ||
901 | 161 | double Microtime::val_real(void) | 161 | double Microtime::val_real(void) const |
902 | 162 | { | 162 | { |
903 | 163 | uint64_t temp; | 163 | uint64_t temp; |
904 | 164 | type::Time::usec_t micro_temp; | 164 | type::Time::usec_t micro_temp; |
905 | @@ -180,7 +180,7 @@ | |||
906 | 180 | return result; | 180 | return result; |
907 | 181 | } | 181 | } |
908 | 182 | 182 | ||
910 | 183 | type::Decimal *Microtime::val_decimal(type::Decimal *decimal_value) | 183 | type::Decimal *Microtime::val_decimal(type::Decimal *decimal_value) const |
911 | 184 | { | 184 | { |
912 | 185 | type::Time ltime; | 185 | type::Time ltime; |
913 | 186 | 186 | ||
914 | @@ -189,7 +189,7 @@ | |||
915 | 189 | return date2_class_decimal(<ime, decimal_value); | 189 | return date2_class_decimal(<ime, decimal_value); |
916 | 190 | } | 190 | } |
917 | 191 | 191 | ||
919 | 192 | int64_t Microtime::val_int(void) | 192 | int64_t Microtime::val_int(void) const |
920 | 193 | { | 193 | { |
921 | 194 | uint64_t temp; | 194 | uint64_t temp; |
922 | 195 | 195 | ||
923 | @@ -207,7 +207,7 @@ | |||
924 | 207 | return result; | 207 | return result; |
925 | 208 | } | 208 | } |
926 | 209 | 209 | ||
928 | 210 | String *Microtime::val_str(String *val_buffer, String *) | 210 | String *Microtime::val_str(String *val_buffer, String *) const |
929 | 211 | { | 211 | { |
930 | 212 | uint64_t temp= 0; | 212 | uint64_t temp= 0; |
931 | 213 | type::Time::usec_t micro_temp= 0; | 213 | type::Time::usec_t micro_temp= 0; |
932 | @@ -224,7 +224,7 @@ | |||
933 | 224 | return val_buffer; | 224 | return val_buffer; |
934 | 225 | } | 225 | } |
935 | 226 | 226 | ||
937 | 227 | bool Microtime::get_date(type::Time <ime, uint32_t) | 227 | bool Microtime::get_date(type::Time <ime, uint32_t) const |
938 | 228 | { | 228 | { |
939 | 229 | uint64_t temp; | 229 | uint64_t temp; |
940 | 230 | uint32_t micro_temp= 0; | 230 | uint32_t micro_temp= 0; |
941 | @@ -239,7 +239,7 @@ | |||
942 | 239 | return false; | 239 | return false; |
943 | 240 | } | 240 | } |
944 | 241 | 241 | ||
946 | 242 | bool Microtime::get_time(type::Time <ime) | 242 | bool Microtime::get_time(type::Time <ime) const |
947 | 243 | { | 243 | { |
948 | 244 | return Microtime::get_date(ltime, 0); | 244 | return Microtime::get_date(ltime, 0); |
949 | 245 | } | 245 | } |
950 | @@ -294,7 +294,7 @@ | |||
951 | 294 | pack_num(fractional_seconds, ptr +8); | 294 | pack_num(fractional_seconds, ptr +8); |
952 | 295 | } | 295 | } |
953 | 296 | 296 | ||
955 | 297 | long Microtime::get_timestamp(bool *null_value) | 297 | long Microtime::get_timestamp(bool *null_value) const |
956 | 298 | { | 298 | { |
957 | 299 | if ((*null_value= is_null())) | 299 | if ((*null_value= is_null())) |
958 | 300 | return 0; | 300 | return 0; |
959 | 301 | 301 | ||
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 | 56 | int store(int64_t nr, bool unsigned_val); | 56 | int store(int64_t nr, bool unsigned_val); |
965 | 57 | int store_time(type::Time <ime, type::timestamp_t t_type); | 57 | int store_time(type::Time <ime, type::timestamp_t t_type); |
966 | 58 | 58 | ||
971 | 59 | String *val_str(String*,String *); | 59 | String *val_str(String*,String *) const; |
972 | 60 | double val_real(void); | 60 | double val_real(void) const; |
973 | 61 | int64_t val_int(void); | 61 | int64_t val_int(void) const; |
974 | 62 | type::Decimal *val_decimal(type::Decimal *decimal_value); | 62 | type::Decimal *val_decimal(type::Decimal *decimal_value) const; |
975 | 63 | 63 | ||
976 | 64 | int cmp(const unsigned char *,const unsigned char *); | 64 | int cmp(const unsigned char *,const unsigned char *); |
977 | 65 | void sort_string(unsigned char *buff,uint32_t length); | 65 | void sort_string(unsigned char *buff,uint32_t length); |
978 | @@ -70,11 +70,11 @@ | |||
979 | 70 | void set_time(); | 70 | void set_time(); |
980 | 71 | 71 | ||
981 | 72 | /* Get TIMESTAMP field value as seconds since begging of Unix Microtime */ | 72 | /* Get TIMESTAMP field value as seconds since begging of Unix Microtime */ |
983 | 73 | long get_timestamp(bool *null_value); | 73 | long get_timestamp(bool *null_value) const; |
984 | 74 | 74 | ||
985 | 75 | private: | 75 | private: |
988 | 76 | bool get_date(type::Time <ime,uint32_t fuzzydate); | 76 | bool get_date(type::Time <ime,uint32_t fuzzydate) const; |
989 | 77 | bool get_time(type::Time <ime); | 77 | bool get_time(type::Time <ime) const; |
990 | 78 | 78 | ||
991 | 79 | public: | 79 | public: |
992 | 80 | static size_t max_string_length() | 80 | static size_t max_string_length() |
993 | 81 | 81 | ||
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 | 79 | { | 79 | { |
999 | 80 | return 0; | 80 | return 0; |
1000 | 81 | } | 81 | } |
1002 | 82 | double val_real(void) | 82 | double val_real(void) const |
1003 | 83 | { | 83 | { |
1004 | 84 | return 0.0; | 84 | return 0.0; |
1005 | 85 | } | 85 | } |
1015 | 86 | int64_t val_int(void) | 86 | int64_t val_int(void) const |
1016 | 87 | { | 87 | { |
1017 | 88 | return 0; | 88 | return 0; |
1018 | 89 | } | 89 | } |
1019 | 90 | type::Decimal *val_decimal(type::Decimal *) | 90 | type::Decimal *val_decimal(type::Decimal *) const |
1020 | 91 | { | 91 | { |
1021 | 92 | return 0; | 92 | return 0; |
1022 | 93 | } | 93 | } |
1023 | 94 | String *val_str(String *, String *value2) | 94 | String *val_str(String *, String *value2) const |
1024 | 95 | { | 95 | { |
1025 | 96 | value2->length(0); | 96 | value2->length(0); |
1026 | 97 | return value2; | 97 | return value2; |
1027 | 98 | 98 | ||
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 | 189 | pointer to decimal buffer with value of field | 189 | pointer to decimal buffer with value of field |
1033 | 190 | */ | 190 | */ |
1034 | 191 | 191 | ||
1036 | 192 | type::Decimal* Field_num::val_decimal(type::Decimal *decimal_value) | 192 | type::Decimal* Field_num::val_decimal(type::Decimal *decimal_value) const |
1037 | 193 | { | 193 | { |
1038 | 194 | assert(result_type() == INT_RESULT); | 194 | assert(result_type() == INT_RESULT); |
1039 | 195 | 195 | ||
1040 | 196 | 196 | ||
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 | 52 | 52 | ||
1046 | 53 | int store_decimal(const type::Decimal *); | 53 | int store_decimal(const type::Decimal *); |
1047 | 54 | 54 | ||
1049 | 55 | type::Decimal *val_decimal(type::Decimal *); | 55 | type::Decimal *val_decimal(type::Decimal *) const; |
1050 | 56 | 56 | ||
1051 | 57 | uint32_t is_equal(CreateField *new_field); | 57 | uint32_t is_equal(CreateField *new_field); |
1052 | 58 | 58 | ||
1053 | 59 | 59 | ||
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 | 136 | return store(dbl); | 136 | return store(dbl); |
1059 | 137 | } | 137 | } |
1060 | 138 | 138 | ||
1062 | 139 | type::Decimal *Field_real::val_decimal(type::Decimal *decimal_value) | 139 | type::Decimal *Field_real::val_decimal(type::Decimal *decimal_value) const |
1063 | 140 | { | 140 | { |
1064 | 141 | ASSERT_COLUMN_MARKED_FOR_READ; | 141 | ASSERT_COLUMN_MARKED_FOR_READ; |
1065 | 142 | 142 | ||
1066 | 143 | 143 | ||
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 | 43 | not_fixed(dec_arg >= NOT_FIXED_DEC) | 43 | not_fixed(dec_arg >= NOT_FIXED_DEC) |
1072 | 44 | {} | 44 | {} |
1073 | 45 | int store_decimal(const type::Decimal *); | 45 | int store_decimal(const type::Decimal *); |
1075 | 46 | type::Decimal *val_decimal(type::Decimal *); | 46 | type::Decimal *val_decimal(type::Decimal *) const; |
1076 | 47 | int truncate(double *nr, double max_length); | 47 | int truncate(double *nr, double max_length); |
1077 | 48 | uint32_t max_display_length() { return field_length; } | 48 | uint32_t max_display_length() { return field_length; } |
1078 | 49 | uint32_t size_of() const { return sizeof(*this); } | 49 | uint32_t size_of() const { return sizeof(*this); } |
1079 | 50 | 50 | ||
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 | 157 | } | 157 | } |
1085 | 158 | 158 | ||
1086 | 159 | 159 | ||
1088 | 160 | double Size::val_real(void) | 160 | double Size::val_real(void) const |
1089 | 161 | { | 161 | { |
1090 | 162 | int64_t j; | 162 | int64_t j; |
1091 | 163 | 163 | ||
1092 | @@ -169,7 +169,7 @@ | |||
1093 | 169 | } | 169 | } |
1094 | 170 | 170 | ||
1095 | 171 | 171 | ||
1097 | 172 | int64_t Size::val_int(void) | 172 | int64_t Size::val_int(void) const |
1098 | 173 | { | 173 | { |
1099 | 174 | int64_t j; | 174 | int64_t j; |
1100 | 175 | 175 | ||
1101 | @@ -181,7 +181,7 @@ | |||
1102 | 181 | } | 181 | } |
1103 | 182 | 182 | ||
1104 | 183 | 183 | ||
1106 | 184 | String *Size::val_str(String *val_buffer, String *) | 184 | String *Size::val_str(String *val_buffer, String *) const |
1107 | 185 | { | 185 | { |
1108 | 186 | const CHARSET_INFO * const cs= &my_charset_bin; | 186 | const CHARSET_INFO * const cs= &my_charset_bin; |
1109 | 187 | uint32_t length; | 187 | uint32_t length; |
1110 | 188 | 188 | ||
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 | 60 | ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0; | 60 | ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0; |
1116 | 61 | return 0; | 61 | return 0; |
1117 | 62 | } | 62 | } |
1121 | 63 | double val_real(void); | 63 | double val_real(void) const; |
1122 | 64 | int64_t val_int(void); | 64 | int64_t val_int(void) const; |
1123 | 65 | String *val_str(String*,String *); | 65 | String *val_str(String*,String *) const; |
1124 | 66 | int cmp(const unsigned char *,const unsigned char *); | 66 | int cmp(const unsigned char *,const unsigned char *); |
1125 | 67 | void sort_string(unsigned char *buff,uint32_t length); | 67 | void sort_string(unsigned char *buff,uint32_t length); |
1126 | 68 | uint32_t pack_length() const { return 8; } | 68 | uint32_t pack_length() const { return 8; } |
1127 | 69 | 69 | ||
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 | 110 | return store(str.ptr(), str.length(), str.charset()); | 110 | return store(str.ptr(), str.length(), str.charset()); |
1133 | 111 | } | 111 | } |
1134 | 112 | 112 | ||
1136 | 113 | type::Decimal *Field_str::val_decimal(type::Decimal *decimal_value) | 113 | type::Decimal *Field_str::val_decimal(type::Decimal *decimal_value) const |
1137 | 114 | { | 114 | { |
1138 | 115 | int64_t nr= val_int(); | 115 | int64_t nr= val_int(); |
1139 | 116 | int2_class_decimal(E_DEC_FATAL_ERROR, nr, 0, decimal_value); | 116 | int2_class_decimal(E_DEC_FATAL_ERROR, nr, 0, decimal_value); |
1140 | 117 | 117 | ||
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 | 65 | bool binary() const { return field_charset == &my_charset_bin; } | 65 | bool binary() const { return field_charset == &my_charset_bin; } |
1146 | 66 | uint32_t max_display_length() { return field_length; } | 66 | uint32_t max_display_length() { return field_length; } |
1147 | 67 | friend class CreateField; | 67 | friend class CreateField; |
1149 | 68 | type::Decimal *val_decimal(type::Decimal *); | 68 | type::Decimal *val_decimal(type::Decimal *) const; |
1150 | 69 | virtual bool str_needs_quotes() { return true; } | 69 | virtual bool str_needs_quotes() { return true; } |
1151 | 70 | uint32_t max_data_length() const; | 70 | uint32_t max_data_length() const; |
1152 | 71 | }; | 71 | }; |
1153 | 72 | 72 | ||
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 | 161 | memcpy(ptr, &tmp, sizeof(int32_t)); | 161 | memcpy(ptr, &tmp, sizeof(int32_t)); |
1159 | 162 | } | 162 | } |
1160 | 163 | 163 | ||
1162 | 164 | void Time::unpack_time(drizzled::Time &temporal) | 164 | void Time::unpack_time(drizzled::Time &temporal) const |
1163 | 165 | { | 165 | { |
1164 | 166 | int32_t tmp; | 166 | int32_t tmp; |
1165 | 167 | 167 | ||
1166 | @@ -171,18 +171,18 @@ | |||
1167 | 171 | temporal.from_int32_t(tmp); | 171 | temporal.from_int32_t(tmp); |
1168 | 172 | } | 172 | } |
1169 | 173 | 173 | ||
1171 | 174 | void Time::unpack_time(int32_t &destination, const unsigned char *source) | 174 | void Time::unpack_time(int32_t &destination, const unsigned char *source) const |
1172 | 175 | { | 175 | { |
1173 | 176 | memcpy(&destination, source, sizeof(int32_t)); | 176 | memcpy(&destination, source, sizeof(int32_t)); |
1174 | 177 | destination= htonl(destination); | 177 | destination= htonl(destination); |
1175 | 178 | } | 178 | } |
1176 | 179 | 179 | ||
1178 | 180 | double Time::val_real(void) | 180 | double Time::val_real(void) const |
1179 | 181 | { | 181 | { |
1180 | 182 | return (double) Time::val_int(); | 182 | return (double) Time::val_int(); |
1181 | 183 | } | 183 | } |
1182 | 184 | 184 | ||
1184 | 185 | int64_t Time::val_int(void) | 185 | int64_t Time::val_int(void) const |
1185 | 186 | { | 186 | { |
1186 | 187 | ASSERT_COLUMN_MARKED_FOR_READ; | 187 | ASSERT_COLUMN_MARKED_FOR_READ; |
1187 | 188 | 188 | ||
1188 | @@ -195,7 +195,7 @@ | |||
1189 | 195 | return result; | 195 | return result; |
1190 | 196 | } | 196 | } |
1191 | 197 | 197 | ||
1193 | 198 | String *Time::val_str(String *val_buffer, String *) | 198 | String *Time::val_str(String *val_buffer, String *) const |
1194 | 199 | { | 199 | { |
1195 | 200 | char *to; | 200 | char *to; |
1196 | 201 | int to_len= field_length + 1; | 201 | int to_len= field_length + 1; |
1197 | @@ -216,7 +216,7 @@ | |||
1198 | 216 | return val_buffer; | 216 | return val_buffer; |
1199 | 217 | } | 217 | } |
1200 | 218 | 218 | ||
1202 | 219 | bool Time::get_date(type::Time <ime, uint32_t) | 219 | bool Time::get_date(type::Time <ime, uint32_t) const |
1203 | 220 | { | 220 | { |
1204 | 221 | ltime.reset(); | 221 | ltime.reset(); |
1205 | 222 | 222 | ||
1206 | @@ -234,7 +234,7 @@ | |||
1207 | 234 | return 0; | 234 | return 0; |
1208 | 235 | } | 235 | } |
1209 | 236 | 236 | ||
1211 | 237 | bool Time::get_time(type::Time <ime) | 237 | bool Time::get_time(type::Time <ime) const |
1212 | 238 | { | 238 | { |
1213 | 239 | return Time::get_date(ltime, 0); | 239 | return Time::get_date(ltime, 0); |
1214 | 240 | } | 240 | } |
1215 | @@ -275,7 +275,7 @@ | |||
1216 | 275 | res.set_ascii(STRING_WITH_LEN("timestamp")); | 275 | res.set_ascii(STRING_WITH_LEN("timestamp")); |
1217 | 276 | } | 276 | } |
1218 | 277 | 277 | ||
1220 | 278 | long Time::get_timestamp(bool *null_value) | 278 | long Time::get_timestamp(bool *null_value) const |
1221 | 279 | { | 279 | { |
1222 | 280 | if ((*null_value= is_null())) | 280 | if ((*null_value= is_null())) |
1223 | 281 | return 0; | 281 | return 0; |
1224 | 282 | 282 | ||
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 | 53 | int store(double nr); | 53 | int store(double nr); |
1230 | 54 | int store(int64_t nr, bool unsigned_val); | 54 | int store(int64_t nr, bool unsigned_val); |
1231 | 55 | int reset(void) { ptr[0]= ptr[1]= ptr[2]= ptr[3]= 0; return 0; } | 55 | int reset(void) { ptr[0]= ptr[1]= ptr[2]= ptr[3]= 0; return 0; } |
1235 | 56 | double val_real(void); | 56 | double val_real(void) const; |
1236 | 57 | int64_t val_int(void); | 57 | int64_t val_int(void) const; |
1237 | 58 | String *val_str(String*,String *); | 58 | String *val_str(String*,String *) const; |
1238 | 59 | int cmp(const unsigned char *,const unsigned char *); | 59 | int cmp(const unsigned char *,const unsigned char *); |
1239 | 60 | void sort_string(unsigned char *buff,uint32_t length); | 60 | void sort_string(unsigned char *buff,uint32_t length); |
1240 | 61 | uint32_t pack_length() const { return 4; } | 61 | uint32_t pack_length() const { return 4; } |
1241 | @@ -64,17 +64,17 @@ | |||
1242 | 64 | bool zero_pack() const { return 0; } | 64 | bool zero_pack() const { return 0; } |
1243 | 65 | 65 | ||
1244 | 66 | /* Get TIME field value as seconds since begging of Unix Epoch */ | 66 | /* Get TIME field value as seconds since begging of Unix Epoch */ |
1246 | 67 | long get_timestamp(bool *null_value); | 67 | long get_timestamp(bool *null_value) const; |
1247 | 68 | private: | 68 | private: |
1250 | 69 | bool get_date(type::Time <ime,uint32_t fuzzydate); | 69 | bool get_date(type::Time <ime, uint32_t fuzzydate) const; |
1251 | 70 | bool get_time(type::Time <ime); | 70 | bool get_time(type::Time <ime) const; |
1252 | 71 | 71 | ||
1253 | 72 | public: | 72 | public: |
1254 | 73 | timestamp_auto_set_type get_auto_set_type() const; | 73 | timestamp_auto_set_type get_auto_set_type() const; |
1255 | 74 | static size_t max_string_length(); | 74 | static size_t max_string_length(); |
1256 | 75 | void pack_time(drizzled::Time &arg); | 75 | void pack_time(drizzled::Time &arg); |
1259 | 76 | void unpack_time(drizzled::Time &arg); | 76 | void unpack_time(drizzled::Time &arg) const; |
1260 | 77 | void unpack_time(int32_t &destination, const unsigned char *source); | 77 | void unpack_time(int32_t &destination, const unsigned char *source) const; |
1261 | 78 | }; | 78 | }; |
1262 | 79 | 79 | ||
1263 | 80 | } /* namespace field */ | 80 | } /* namespace field */ |
1264 | 81 | 81 | ||
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 | 103 | res.set_ascii(STRING_WITH_LEN("uuid")); | 103 | res.set_ascii(STRING_WITH_LEN("uuid")); |
1270 | 104 | } | 104 | } |
1271 | 105 | 105 | ||
1273 | 106 | double Uuid::val_real() | 106 | double Uuid::val_real() const |
1274 | 107 | { | 107 | { |
1275 | 108 | ASSERT_COLUMN_MARKED_FOR_READ; | 108 | ASSERT_COLUMN_MARKED_FOR_READ; |
1276 | 109 | my_error(ER_INVALID_UUID_VALUE, MYF(ME_FATALERROR)); | 109 | my_error(ER_INVALID_UUID_VALUE, MYF(ME_FATALERROR)); |
1277 | 110 | return 0; | 110 | return 0; |
1278 | 111 | } | 111 | } |
1279 | 112 | 112 | ||
1281 | 113 | int64_t Uuid::val_int() | 113 | int64_t Uuid::val_int() const |
1282 | 114 | { | 114 | { |
1283 | 115 | ASSERT_COLUMN_MARKED_FOR_READ; | 115 | ASSERT_COLUMN_MARKED_FOR_READ; |
1284 | 116 | my_error(ER_INVALID_UUID_VALUE, MYF(ME_FATALERROR)); | 116 | my_error(ER_INVALID_UUID_VALUE, MYF(ME_FATALERROR)); |
1285 | @@ -133,7 +133,7 @@ | |||
1286 | 133 | } | 133 | } |
1287 | 134 | #endif | 134 | #endif |
1288 | 135 | 135 | ||
1290 | 136 | String *Uuid::val_str(String *val_buffer, String *) | 136 | String *Uuid::val_str(String *val_buffer, String *) const |
1291 | 137 | { | 137 | { |
1292 | 138 | const CHARSET_INFO * const cs= &my_charset_bin; | 138 | const CHARSET_INFO * const cs= &my_charset_bin; |
1293 | 139 | uint32_t mlength= (type::Uuid::DISPLAY_BUFFER_LENGTH) * cs->mbmaxlen; | 139 | uint32_t mlength= (type::Uuid::DISPLAY_BUFFER_LENGTH) * cs->mbmaxlen; |
1294 | @@ -158,7 +158,7 @@ | |||
1295 | 158 | memcpy(to, ptr, length_arg); | 158 | memcpy(to, ptr, length_arg); |
1296 | 159 | } | 159 | } |
1297 | 160 | 160 | ||
1299 | 161 | bool Uuid::get_date(type::Time <ime, uint32_t ) | 161 | bool Uuid::get_date(type::Time <ime, uint32_t ) const |
1300 | 162 | { | 162 | { |
1301 | 163 | type::Uuid uu; | 163 | type::Uuid uu; |
1302 | 164 | 164 | ||
1303 | @@ -181,7 +181,7 @@ | |||
1304 | 181 | return true; | 181 | return true; |
1305 | 182 | } | 182 | } |
1306 | 183 | 183 | ||
1308 | 184 | bool Uuid::get_time(type::Time <ime) | 184 | bool Uuid::get_time(type::Time <ime) const |
1309 | 185 | { | 185 | { |
1310 | 186 | return get_date(ltime, 0); | 186 | return get_date(ltime, 0); |
1311 | 187 | } | 187 | } |
1312 | 188 | 188 | ||
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 | 51 | 51 | ||
1318 | 52 | int store(const char *to, uint32_t length, const CHARSET_INFO * const charset); | 52 | int store(const char *to, uint32_t length, const CHARSET_INFO * const charset); |
1319 | 53 | int store(int64_t nr, bool unsigned_val); | 53 | int store(int64_t nr, bool unsigned_val); |
1323 | 54 | double val_real(); | 54 | double val_real() const; |
1324 | 55 | int64_t val_int(); | 55 | int64_t val_int() const; |
1325 | 56 | String *val_str(String*,String *); | 56 | String *val_str(String*,String *) const; |
1326 | 57 | void sql_type(drizzled::String&) const; | 57 | void sql_type(drizzled::String&) const; |
1327 | 58 | int store_decimal(const drizzled::type::Decimal*); | 58 | int store_decimal(const drizzled::type::Decimal*); |
1328 | 59 | 59 | ||
1329 | @@ -66,8 +66,8 @@ | |||
1330 | 66 | inline String *val_str(String *str) { return val_str(str, str); } | 66 | inline String *val_str(String *str) { return val_str(str, str); } |
1331 | 67 | uint32_t size_of() const { return sizeof(*this); } | 67 | uint32_t size_of() const { return sizeof(*this); } |
1332 | 68 | 68 | ||
1335 | 69 | bool get_date(type::Time <ime, uint32_t); | 69 | bool get_date(type::Time <ime, uint32_t) const; |
1336 | 70 | bool get_time(type::Time <ime); | 70 | bool get_time(type::Time <ime) const; |
1337 | 71 | 71 | ||
1338 | 72 | #ifdef NOT_YET | 72 | #ifdef NOT_YET |
1339 | 73 | void generate(); | 73 | void generate(); |
1340 | 74 | 74 | ||
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 | 124 | } | 124 | } |
1346 | 125 | 125 | ||
1347 | 126 | 126 | ||
1349 | 127 | double Field_varstring::val_real(void) | 127 | double Field_varstring::val_real(void) const |
1350 | 128 | { | 128 | { |
1351 | 129 | int not_used; | 129 | int not_used; |
1352 | 130 | char *end_not_used; | 130 | char *end_not_used; |
1353 | @@ -138,7 +138,7 @@ | |||
1354 | 138 | } | 138 | } |
1355 | 139 | 139 | ||
1356 | 140 | 140 | ||
1358 | 141 | int64_t Field_varstring::val_int(void) | 141 | int64_t Field_varstring::val_int(void) const |
1359 | 142 | { | 142 | { |
1360 | 143 | int not_used; | 143 | int not_used; |
1361 | 144 | char *end_not_used; | 144 | char *end_not_used; |
1362 | @@ -152,8 +152,7 @@ | |||
1363 | 152 | &end_not_used, ¬_used); | 152 | &end_not_used, ¬_used); |
1364 | 153 | } | 153 | } |
1365 | 154 | 154 | ||
1368 | 155 | String *Field_varstring::val_str(String *, | 155 | String *Field_varstring::val_str(String *, String *val_ptr) const |
1367 | 156 | String *val_ptr) | ||
1369 | 157 | { | 156 | { |
1370 | 158 | uint32_t length= length_bytes == 1 ? (uint32_t) *ptr : uint2korr(ptr); | 157 | uint32_t length= length_bytes == 1 ? (uint32_t) *ptr : uint2korr(ptr); |
1371 | 159 | 158 | ||
1372 | @@ -165,7 +164,7 @@ | |||
1373 | 165 | } | 164 | } |
1374 | 166 | 165 | ||
1375 | 167 | 166 | ||
1377 | 168 | type::Decimal *Field_varstring::val_decimal(type::Decimal *decimal_value) | 167 | type::Decimal *Field_varstring::val_decimal(type::Decimal *decimal_value) const |
1378 | 169 | { | 168 | { |
1379 | 170 | uint32_t length; | 169 | uint32_t length; |
1380 | 171 | 170 | ||
1381 | 172 | 171 | ||
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 | 74 | 74 | ||
1387 | 75 | int store(int64_t nr, bool unsigned_val); | 75 | int store(int64_t nr, bool unsigned_val); |
1388 | 76 | int store(double nr) { return Field_str::store(nr); } /* QQ: To be deleted */ | 76 | int store(double nr) { return Field_str::store(nr); } /* QQ: To be deleted */ |
1392 | 77 | double val_real(void); | 77 | double val_real(void) const; |
1393 | 78 | int64_t val_int(void); | 78 | int64_t val_int(void) const; |
1394 | 79 | String *val_str(String*,String *); | 79 | String *val_str(String*,String *) const; |
1395 | 80 | inline String *val_str(String *str) { return val_str(str, str); } | 80 | inline String *val_str(String *str) { return val_str(str, str); } |
1397 | 81 | type::Decimal *val_decimal(type::Decimal *); | 81 | type::Decimal *val_decimal(type::Decimal *) const; |
1398 | 82 | int cmp_max(const unsigned char *, const unsigned char *, uint32_t max_length); | 82 | int cmp_max(const unsigned char *, const unsigned char *, uint32_t max_length); |
1399 | 83 | inline int cmp(const unsigned char *str) { return cmp(ptr,str); } | 83 | inline int cmp(const unsigned char *str) { return cmp(ptr,str); } |
1400 | 84 | int cmp(const unsigned char *a,const unsigned char *b) | 84 | int cmp(const unsigned char *a,const unsigned char *b) |
1401 | 85 | 85 | ||
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 | 499 | } | 499 | } |
1407 | 500 | 500 | ||
1408 | 501 | /* Both of the below should go away once we can move this bit to the field objects */ | 501 | /* Both of the below should go away once we can move this bit to the field objects */ |
1410 | 502 | inline bool isReadSet(uint32_t index) | 502 | inline bool isReadSet(uint32_t index) const |
1411 | 503 | { | 503 | { |
1412 | 504 | return read_set->test(index); | 504 | return read_set->test(index); |
1413 | 505 | } | 505 | } |