Status: | Needs review |
---|---|
Proposed branch: | lp:~olafvdspek/drizzle/rf1 |
Merge into: | lp:drizzle |
Diff against target: |
397 lines (+49/-150) 3 files modified
drizzled/error/sql_state.cc (+4/-9) drizzled/error/sql_state.h (+3/-5) drizzled/table/instance/base.cc (+42/-136) |
To merge this branch: | bzr merge lp:~olafvdspek/drizzle/rf1 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Drizzle Trunk | Pending | ||
Review via email: mp+118245@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Olaf van der Spek (olafvdspek) wrote : | # |
Do we? Coding standards doesn't mention it. It even contains a few examples that don't.
Revision history for this message
Brian Aker (brianaker) wrote : | # |
This is something that Trond slipped up on at one point. I thought we had updated the style guide for this.
Revision history for this message
Olaf van der Spek (olafvdspek) wrote : | # |
Where did I remove the braces?
Revision history for this message
Olaf van der Spek (olafvdspek) wrote : | # |
Ah, I found one if statement. Do you want me to update the patch?
--
Olaf
Unmerged revisions
- 2579. By Olaf van der Spek
-
Refactor
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'drizzled/error/sql_state.cc' | |||
2 | --- drizzled/error/sql_state.cc 2011-02-17 00:14:13 +0000 | |||
3 | +++ drizzled/error/sql_state.cc 2012-08-04 14:50:32 +0000 | |||
4 | @@ -28,15 +28,12 @@ | |||
5 | 28 | 28 | ||
6 | 29 | using namespace std; | 29 | using namespace std; |
7 | 30 | 30 | ||
13 | 31 | namespace drizzled | 31 | namespace drizzled { |
14 | 32 | { | 32 | namespace error { |
10 | 33 | |||
11 | 34 | namespace error | ||
12 | 35 | { | ||
15 | 36 | 33 | ||
16 | 37 | struct sql_state_t | 34 | struct sql_state_t |
17 | 38 | { | 35 | { |
19 | 39 | drizzled::error_t drizzle_errno; | 36 | error_t drizzle_errno; |
20 | 40 | const char *odbc_state; | 37 | const char *odbc_state; |
21 | 41 | const char *jdbc_state; | 38 | const char *jdbc_state; |
22 | 42 | }; | 39 | }; |
23 | @@ -171,15 +168,13 @@ | |||
24 | 171 | { ER_DUP_ENTRY_WITH_KEY_NAME ,"23000", "S1009" }, | 168 | { ER_DUP_ENTRY_WITH_KEY_NAME ,"23000", "S1009" }, |
25 | 172 | }; | 169 | }; |
26 | 173 | 170 | ||
29 | 174 | static bool compare_errno_map(sql_state_t a, | 171 | static bool compare_errno_map(sql_state_t a, sql_state_t b) |
28 | 175 | sql_state_t b) | ||
30 | 176 | { | 172 | { |
31 | 177 | return (a.drizzle_errno < b.drizzle_errno); | 173 | return (a.drizzle_errno < b.drizzle_errno); |
32 | 178 | } | 174 | } |
33 | 179 | 175 | ||
34 | 180 | const char *convert_to_sqlstate(drizzled::error_t drizzle_errno) | 176 | const char *convert_to_sqlstate(drizzled::error_t drizzle_errno) |
35 | 181 | { | 177 | { |
36 | 182 | |||
37 | 183 | sql_state_t drizzle_err_state= {drizzle_errno, NULL, NULL}; | 178 | sql_state_t drizzle_err_state= {drizzle_errno, NULL, NULL}; |
38 | 184 | sql_state_t* result= | 179 | sql_state_t* result= |
39 | 185 | lower_bound(&sqlstate_map[0], | 180 | lower_bound(&sqlstate_map[0], |
40 | 186 | 181 | ||
41 | === modified file 'drizzled/error/sql_state.h' | |||
42 | --- drizzled/error/sql_state.h 2011-03-14 05:40:28 +0000 | |||
43 | +++ drizzled/error/sql_state.h 2012-08-04 14:50:32 +0000 | |||
44 | @@ -19,12 +19,10 @@ | |||
45 | 19 | 19 | ||
46 | 20 | #pragma once | 20 | #pragma once |
47 | 21 | 21 | ||
52 | 22 | namespace drizzled | 22 | namespace drizzled { |
53 | 23 | { | 23 | namespace error { |
50 | 24 | namespace error | ||
51 | 25 | { | ||
54 | 26 | 24 | ||
56 | 27 | const char *convert_to_sqlstate(drizzled::error_t drizzle_errno); | 25 | const char* convert_to_sqlstate(error_t); |
57 | 28 | 26 | ||
58 | 29 | } /* namespace error */ | 27 | } /* namespace error */ |
59 | 30 | } /* namespace drizzled */ | 28 | } /* namespace drizzled */ |
60 | 31 | 29 | ||
61 | === modified file 'drizzled/table/instance/base.cc' | |||
62 | --- drizzled/table/instance/base.cc 2012-07-11 14:06:00 +0000 | |||
63 | +++ drizzled/table/instance/base.cc 2012-08-04 14:50:32 +0000 | |||
64 | @@ -34,7 +34,6 @@ | |||
65 | 34 | #include <sys/stat.h> | 34 | #include <sys/stat.h> |
66 | 35 | #include <fcntl.h> | 35 | #include <fcntl.h> |
67 | 36 | 36 | ||
68 | 37 | |||
69 | 38 | #include <cassert> | 37 | #include <cassert> |
70 | 39 | 38 | ||
71 | 40 | #include <drizzled/error.h> | 39 | #include <drizzled/error.h> |
72 | @@ -147,7 +146,7 @@ | |||
73 | 147 | abort(); | 146 | abort(); |
74 | 148 | } | 147 | } |
75 | 149 | 148 | ||
77 | 150 | static Item* default_value_item(enum_field_types field_type, const charset_info_st& charset, bool default_null, | 149 | static Item* default_value_item(enum_field_types field_type, const charset_info_st& charset, bool default_null, |
78 | 151 | const string& default_value, const string& default_bin_value) | 150 | const string& default_value, const string& default_bin_value) |
79 | 152 | { | 151 | { |
80 | 153 | if (default_null) | 152 | if (default_null) |
81 | @@ -498,7 +497,7 @@ | |||
82 | 498 | normalized_path= str_ref(new_path); | 497 | normalized_path= str_ref(new_path); |
83 | 499 | } | 498 | } |
84 | 500 | 499 | ||
86 | 501 | TableShare::~TableShare() | 500 | TableShare::~TableShare() |
87 | 502 | { | 501 | { |
88 | 503 | storage_engine= NULL; | 502 | storage_engine= NULL; |
89 | 504 | delete table_identifier; | 503 | delete table_identifier; |
90 | @@ -676,15 +675,11 @@ | |||
91 | 676 | if (table.field(part.fieldnr()).type() == message::Table::Field::VARCHAR | 675 | if (table.field(part.fieldnr()).type() == message::Table::Field::VARCHAR |
92 | 677 | || table.field(part.fieldnr()).type() == message::Table::Field::BLOB) | 676 | || table.field(part.fieldnr()).type() == message::Table::Field::BLOB) |
93 | 678 | { | 677 | { |
100 | 679 | uint32_t collation_id; | 678 | uint32_t collation_id= table.field(part.fieldnr()).string_options().has_collation_id() |
101 | 680 | 679 | ? table.field(part.fieldnr()).string_options().collation_id() | |
102 | 681 | if (table.field(part.fieldnr()).string_options().has_collation_id()) | 680 | : table.options().collation_id(); |
97 | 682 | collation_id= table.field(part.fieldnr()).string_options().collation_id(); | ||
98 | 683 | else | ||
99 | 684 | collation_id= table.options().collation_id(); | ||
103 | 685 | 681 | ||
104 | 686 | const charset_info_st *cs= get_charset(collation_id); | 682 | const charset_info_st *cs= get_charset(collation_id); |
105 | 687 | |||
106 | 688 | mbmaxlen= cs->mbmaxlen; | 683 | mbmaxlen= cs->mbmaxlen; |
107 | 689 | } | 684 | } |
108 | 690 | key_part->length*= mbmaxlen; | 685 | key_part->length*= mbmaxlen; |
109 | @@ -872,7 +867,7 @@ | |||
110 | 872 | { | 867 | { |
111 | 873 | t->type_names[n]= mem().strdup(field_options.field_value(n)); | 868 | t->type_names[n]= mem().strdup(field_options.field_value(n)); |
112 | 874 | 869 | ||
114 | 875 | /* | 870 | /* |
115 | 876 | * Go ask the charset what the length is as for "" length=1 | 871 | * Go ask the charset what the length is as for "" length=1 |
116 | 877 | * and there's stripping spaces or some other crack going on. | 872 | * and there's stripping spaces or some other crack going on. |
117 | 878 | */ | 873 | */ |
118 | @@ -911,7 +906,7 @@ | |||
119 | 911 | { | 906 | { |
120 | 912 | unireg_type= Field::TIMESTAMP_DNUN_FIELD; | 907 | unireg_type= Field::TIMESTAMP_DNUN_FIELD; |
121 | 913 | } | 908 | } |
123 | 914 | else if (! pfield.options().has_update_expression()) | 909 | else if (not pfield.options().has_update_expression()) |
124 | 915 | { | 910 | { |
125 | 916 | unireg_type= Field::TIMESTAMP_DN_FIELD; | 911 | unireg_type= Field::TIMESTAMP_DN_FIELD; |
126 | 917 | } | 912 | } |
127 | @@ -1010,10 +1005,9 @@ | |||
128 | 1010 | { | 1005 | { |
129 | 1011 | message::Table::Field::StringFieldOptions field_options= pfield.string_options(); | 1006 | message::Table::Field::StringFieldOptions field_options= pfield.string_options(); |
130 | 1012 | 1007 | ||
133 | 1013 | charset= get_charset(field_options.has_collation_id() ? | 1008 | charset= get_charset(field_options.has_collation_id() ? field_options.collation_id() : 0); |
132 | 1014 | field_options.collation_id() : 0); | ||
134 | 1015 | 1009 | ||
136 | 1016 | if (! charset) | 1010 | if (not charset) |
137 | 1017 | charset= default_charset_info; | 1011 | charset= default_charset_info; |
138 | 1018 | 1012 | ||
139 | 1019 | field_length= field_options.length() * charset->mbmaxlen; | 1013 | field_length= field_options.length() * charset->mbmaxlen; |
140 | @@ -1043,8 +1037,7 @@ | |||
141 | 1043 | { | 1037 | { |
142 | 1044 | message::Table::Field::NumericFieldOptions fo= pfield.numeric_options(); | 1038 | message::Table::Field::NumericFieldOptions fo= pfield.numeric_options(); |
143 | 1045 | 1039 | ||
146 | 1046 | field_length= class_decimal_precision_to_length(fo.precision(), fo.scale(), | 1040 | field_length= class_decimal_precision_to_length(fo.precision(), fo.scale(), false); |
145 | 1047 | false); | ||
147 | 1048 | break; | 1041 | break; |
148 | 1049 | } | 1042 | } |
149 | 1050 | case DRIZZLE_TYPE_DATETIME: | 1043 | case DRIZZLE_TYPE_DATETIME: |
150 | @@ -1106,16 +1099,7 @@ | |||
151 | 1106 | abort(); // Programming error | 1099 | abort(); // Programming error |
152 | 1107 | } | 1100 | } |
153 | 1108 | 1101 | ||
164 | 1109 | bool is_not_null= false; | 1102 | bool is_not_null= not pfield.constraints().is_nullable() || pfield.constraints().is_notnull(); |
155 | 1110 | |||
156 | 1111 | if (not pfield.constraints().is_nullable()) | ||
157 | 1112 | { | ||
158 | 1113 | is_not_null= true; | ||
159 | 1114 | } | ||
160 | 1115 | else if (pfield.constraints().is_notnull()) | ||
161 | 1116 | { | ||
162 | 1117 | is_not_null= true; | ||
163 | 1118 | } | ||
165 | 1119 | 1103 | ||
166 | 1120 | Field* f= make_field(pfield, | 1104 | Field* f= make_field(pfield, |
167 | 1121 | record + field_offsets[fieldnr] + data_offset, | 1105 | record + field_offsets[fieldnr] + data_offset, |
168 | @@ -1212,8 +1196,7 @@ | |||
169 | 1212 | 1196 | ||
170 | 1213 | if (use_hash) /* supposedly this never fails... but comments lie */ | 1197 | if (use_hash) /* supposedly this never fails... but comments lie */ |
171 | 1214 | { | 1198 | { |
174 | 1215 | const char *local_field_name= _fields[fieldnr]->field_name; | 1199 | name_hash.insert(make_pair(_fields[fieldnr]->field_name, &(_fields[fieldnr]))); |
173 | 1216 | name_hash.insert(make_pair(local_field_name, &(_fields[fieldnr]))); | ||
175 | 1217 | } | 1200 | } |
176 | 1218 | } | 1201 | } |
177 | 1219 | 1202 | ||
178 | @@ -1226,7 +1209,7 @@ | |||
179 | 1226 | partnr < keyinfo->key_parts; | 1209 | partnr < keyinfo->key_parts; |
180 | 1227 | partnr++, key_part++) | 1210 | partnr++, key_part++) |
181 | 1228 | { | 1211 | { |
183 | 1229 | /* | 1212 | /* |
184 | 1230 | * Fix up key_part->offset by adding data_offset. | 1213 | * Fix up key_part->offset by adding data_offset. |
185 | 1231 | * We really should compute offset as well. | 1214 | * We really should compute offset as well. |
186 | 1232 | * But at least this way we are a little better. | 1215 | * But at least this way we are a little better. |
187 | @@ -1359,8 +1342,7 @@ | |||
188 | 1359 | set_if_bigger(max_unique_length,keyinfo->key_length); | 1342 | set_if_bigger(max_unique_length,keyinfo->key_length); |
189 | 1360 | } | 1343 | } |
190 | 1361 | } | 1344 | } |
193 | 1362 | if (local_primary_key < MAX_KEY && | 1345 | if (local_primary_key < MAX_KEY && keys_in_use.test(local_primary_key)) |
192 | 1363 | (keys_in_use.test(local_primary_key))) | ||
194 | 1364 | { | 1346 | { |
195 | 1365 | primary_key= local_primary_key; | 1347 | primary_key= local_primary_key; |
196 | 1366 | /* | 1348 | /* |
197 | @@ -1373,8 +1355,7 @@ | |||
198 | 1373 | if (local_field && local_field->result_type() == INT_RESULT) | 1355 | if (local_field && local_field->result_type() == INT_RESULT) |
199 | 1374 | { | 1356 | { |
200 | 1375 | /* note that fieldnr here (and rowid_field_offset) starts from 1 */ | 1357 | /* note that fieldnr here (and rowid_field_offset) starts from 1 */ |
203 | 1376 | rowid_field_offset= (key_info[local_primary_key].key_part[0]. | 1358 | rowid_field_offset= (key_info[local_primary_key].key_part[0].fieldnr); |
202 | 1377 | fieldnr); | ||
204 | 1378 | } | 1359 | } |
205 | 1379 | } | 1360 | } |
206 | 1380 | } | 1361 | } |
207 | @@ -1597,8 +1578,7 @@ | |||
208 | 1597 | *field_ptr= 0; // End marker | 1578 | *field_ptr= 0; // End marker |
209 | 1598 | 1579 | ||
210 | 1599 | if (found_next_number_field) | 1580 | if (found_next_number_field) |
213 | 1600 | outparam.found_next_number_field= | 1581 | outparam.found_next_number_field= outparam.getField(positionFields(found_next_number_field)); |
212 | 1601 | outparam.getField(positionFields(found_next_number_field)); | ||
214 | 1602 | if (timestamp_field) | 1582 | if (timestamp_field) |
215 | 1603 | outparam.timestamp_field= (field::Epoch*) outparam.getField(timestamp_field->position()); | 1583 | outparam.timestamp_field= (field::Epoch*) outparam.getField(timestamp_field->position()); |
216 | 1604 | 1584 | ||
217 | @@ -1655,11 +1635,9 @@ | |||
218 | 1655 | if (db_stat) | 1635 | if (db_stat) |
219 | 1656 | { | 1636 | { |
220 | 1657 | assert(!(db_stat & HA_WAIT_IF_LOCKED)); | 1637 | assert(!(db_stat & HA_WAIT_IF_LOCKED)); |
226 | 1658 | int ha_err; | 1638 | if (int ha_err= (outparam.cursor->ha_open(identifier, |
227 | 1659 | 1639 | (db_stat & HA_READ_ONLY ? O_RDONLY : O_RDWR), | |
228 | 1660 | if ((ha_err= (outparam.cursor->ha_open(identifier, | 1640 | (db_stat & HA_OPEN_TEMPORARY ? HA_OPEN_TMP_TABLE : HA_OPEN_IGNORE_IF_LOCKED) | ha_open_flags))) |
224 | 1661 | (db_stat & HA_READ_ONLY ? O_RDONLY : O_RDWR), | ||
225 | 1662 | (db_stat & HA_OPEN_TEMPORARY ? HA_OPEN_TMP_TABLE : HA_OPEN_IGNORE_IF_LOCKED) | ha_open_flags)))) | ||
229 | 1663 | { | 1641 | { |
230 | 1664 | switch (ha_err) | 1642 | switch (ha_err) |
231 | 1665 | { | 1643 | { |
232 | @@ -1699,7 +1677,8 @@ | |||
233 | 1699 | char buff[FN_REFLEN]; | 1677 | char buff[FN_REFLEN]; |
234 | 1700 | myf errortype= ME_ERROR+ME_WAITTANG; | 1678 | myf errortype= ME_ERROR+ME_WAITTANG; |
235 | 1701 | 1679 | ||
237 | 1702 | switch (pass_error) { | 1680 | switch (pass_error) |
238 | 1681 | { | ||
239 | 1703 | case 7: | 1682 | case 7: |
240 | 1704 | case 1: | 1683 | case 1: |
241 | 1705 | if (db_errno == ENOENT) | 1684 | if (db_errno == ENOENT) |
242 | @@ -1722,7 +1701,7 @@ | |||
243 | 1722 | { | 1701 | { |
244 | 1723 | const char *csname= get_charset_name((uint32_t) pass_errarg); | 1702 | const char *csname= get_charset_name((uint32_t) pass_errarg); |
245 | 1724 | char tmp[10]; | 1703 | char tmp[10]; |
247 | 1725 | if (!csname || csname[0] =='?') | 1704 | if (not csname || csname[0] =='?') |
248 | 1726 | { | 1705 | { |
249 | 1727 | snprintf(tmp, sizeof(tmp), "#%d", pass_errarg); | 1706 | snprintf(tmp, sizeof(tmp), "#%d", pass_errarg); |
250 | 1728 | csname= tmp; | 1707 | csname= tmp; |
251 | @@ -1784,120 +1763,48 @@ | |||
252 | 1784 | const charset_info_st * field_charset, | 1763 | const charset_info_st * field_charset, |
253 | 1785 | Field::utype unireg_check, | 1764 | Field::utype unireg_check, |
254 | 1786 | TYPELIB *interval, | 1765 | TYPELIB *interval, |
256 | 1787 | const char *field_name, | 1766 | const char *field_name, |
257 | 1788 | bool is_unsigned) | 1767 | bool is_unsigned) |
258 | 1789 | { | 1768 | { |
260 | 1790 | if (! is_nullable) | 1769 | if (is_nullable) |
261 | 1770 | { | ||
262 | 1771 | null_bit= ((unsigned char) 1) << null_bit; | ||
263 | 1772 | } | ||
264 | 1773 | else | ||
265 | 1791 | { | 1774 | { |
266 | 1792 | null_pos=0; | 1775 | null_pos=0; |
267 | 1793 | null_bit=0; | 1776 | null_bit=0; |
268 | 1794 | } | 1777 | } |
269 | 1795 | else | ||
270 | 1796 | { | ||
271 | 1797 | null_bit= ((unsigned char) 1) << null_bit; | ||
272 | 1798 | } | ||
273 | 1799 | 1778 | ||
274 | 1800 | switch (field_type) | 1779 | switch (field_type) |
275 | 1801 | { | 1780 | { |
276 | 1802 | case DRIZZLE_TYPE_ENUM: | 1781 | case DRIZZLE_TYPE_ENUM: |
284 | 1803 | return new (&mem_root) Field_enum(ptr, | 1782 | return new (&mem_root) Field_enum(ptr, field_length, null_pos, null_bit, field_name, interval, field_charset); |
278 | 1804 | field_length, | ||
279 | 1805 | null_pos, | ||
280 | 1806 | null_bit, | ||
281 | 1807 | field_name, | ||
282 | 1808 | interval, | ||
283 | 1809 | field_charset); | ||
285 | 1810 | case DRIZZLE_TYPE_VARCHAR: | 1783 | case DRIZZLE_TYPE_VARCHAR: |
286 | 1811 | setVariableWidth(); | 1784 | setVariableWidth(); |
292 | 1812 | return new (&mem_root) Field_varstring(ptr,field_length, | 1785 | return new (&mem_root) Field_varstring(ptr,field_length, ha_varchar_packlength(field_length), null_pos,null_bit, field_name, field_charset); |
288 | 1813 | ha_varchar_packlength(field_length), | ||
289 | 1814 | null_pos,null_bit, | ||
290 | 1815 | field_name, | ||
291 | 1816 | field_charset); | ||
293 | 1817 | case DRIZZLE_TYPE_BLOB: | 1786 | case DRIZZLE_TYPE_BLOB: |
300 | 1818 | return new (&mem_root) Field_blob(ptr, | 1787 | return new (&mem_root) Field_blob(ptr, null_pos, null_bit, field_name, this, field_charset); |
295 | 1819 | null_pos, | ||
296 | 1820 | null_bit, | ||
297 | 1821 | field_name, | ||
298 | 1822 | this, | ||
299 | 1823 | field_charset); | ||
301 | 1824 | case DRIZZLE_TYPE_DECIMAL: | 1788 | case DRIZZLE_TYPE_DECIMAL: |
309 | 1825 | return new (&mem_root) Field_decimal(ptr, | 1789 | return new (&mem_root) Field_decimal(ptr, field_length, null_pos, null_bit, unireg_check, field_name, decimals); |
303 | 1826 | field_length, | ||
304 | 1827 | null_pos, | ||
305 | 1828 | null_bit, | ||
306 | 1829 | unireg_check, | ||
307 | 1830 | field_name, | ||
308 | 1831 | decimals); | ||
310 | 1832 | case DRIZZLE_TYPE_DOUBLE: | 1790 | case DRIZZLE_TYPE_DOUBLE: |
320 | 1833 | return new (&mem_root) Field_double(ptr, | 1791 | return new (&mem_root) Field_double(ptr, field_length, null_pos, null_bit, unireg_check, field_name, decimals, false, false /* is_unsigned */); |
312 | 1834 | field_length, | ||
313 | 1835 | null_pos, | ||
314 | 1836 | null_bit, | ||
315 | 1837 | unireg_check, | ||
316 | 1838 | field_name, | ||
317 | 1839 | decimals, | ||
318 | 1840 | false, | ||
319 | 1841 | false /* is_unsigned */); | ||
321 | 1842 | case DRIZZLE_TYPE_UUID: | 1792 | case DRIZZLE_TYPE_UUID: |
327 | 1843 | return new (&mem_root) field::Uuid(ptr, | 1793 | return new (&mem_root) field::Uuid(ptr, field_length, null_pos, null_bit, field_name); |
323 | 1844 | field_length, | ||
324 | 1845 | null_pos, | ||
325 | 1846 | null_bit, | ||
326 | 1847 | field_name); | ||
328 | 1848 | case DRIZZLE_TYPE_IPV6: | 1794 | case DRIZZLE_TYPE_IPV6: |
334 | 1849 | return new (&mem_root) field::IPv6(ptr, | 1795 | return new (&mem_root) field::IPv6(ptr, field_length, null_pos, null_bit, field_name); |
330 | 1850 | field_length, | ||
331 | 1851 | null_pos, | ||
332 | 1852 | null_bit, | ||
333 | 1853 | field_name); | ||
335 | 1854 | case DRIZZLE_TYPE_BOOLEAN: | 1796 | case DRIZZLE_TYPE_BOOLEAN: |
342 | 1855 | return new (&mem_root) field::Boolean(ptr, | 1797 | return new (&mem_root) field::Boolean(ptr, field_length, null_pos, null_bit, field_name, is_unsigned); |
337 | 1856 | field_length, | ||
338 | 1857 | null_pos, | ||
339 | 1858 | null_bit, | ||
340 | 1859 | field_name, | ||
341 | 1860 | is_unsigned); | ||
343 | 1861 | case DRIZZLE_TYPE_LONG: | 1798 | case DRIZZLE_TYPE_LONG: |
350 | 1862 | return new (&mem_root) field::Int32(ptr, | 1799 | return new (&mem_root) field::Int32(ptr, field_length, null_pos, null_bit, unireg_check, field_name); |
345 | 1863 | field_length, | ||
346 | 1864 | null_pos, | ||
347 | 1865 | null_bit, | ||
348 | 1866 | unireg_check, | ||
349 | 1867 | field_name); | ||
351 | 1868 | case DRIZZLE_TYPE_LONGLONG: | 1800 | case DRIZZLE_TYPE_LONGLONG: |
370 | 1869 | { | 1801 | if (is_unsigned) |
371 | 1870 | if (is_unsigned) | 1802 | return new (&mem_root) field::Size(ptr, field_length, null_pos, null_bit, unireg_check, field_name); |
372 | 1871 | { | 1803 | return new (&mem_root) field::Int64(ptr, field_length, null_pos, null_bit, unireg_check, field_name); |
355 | 1872 | return new (&mem_root) field::Size(ptr, | ||
356 | 1873 | field_length, | ||
357 | 1874 | null_pos, | ||
358 | 1875 | null_bit, | ||
359 | 1876 | unireg_check, | ||
360 | 1877 | field_name); | ||
361 | 1878 | } | ||
362 | 1879 | |||
363 | 1880 | return new (&mem_root) field::Int64(ptr, | ||
364 | 1881 | field_length, | ||
365 | 1882 | null_pos, | ||
366 | 1883 | null_bit, | ||
367 | 1884 | unireg_check, | ||
368 | 1885 | field_name); | ||
369 | 1886 | } | ||
373 | 1887 | case DRIZZLE_TYPE_MICROTIME: | 1804 | case DRIZZLE_TYPE_MICROTIME: |
380 | 1888 | return new (&mem_root) field::Microtime(ptr, | 1805 | return new (&mem_root) field::Microtime(ptr, null_pos, null_bit, unireg_check, field_name, this); |
375 | 1889 | null_pos, | ||
376 | 1890 | null_bit, | ||
377 | 1891 | unireg_check, | ||
378 | 1892 | field_name, | ||
379 | 1893 | this); | ||
381 | 1894 | case DRIZZLE_TYPE_TIMESTAMP: | 1806 | case DRIZZLE_TYPE_TIMESTAMP: |
388 | 1895 | return new (&mem_root) field::Epoch(ptr, | 1807 | return new (&mem_root) field::Epoch(ptr, null_pos, null_bit, unireg_check, field_name, this); |
383 | 1896 | null_pos, | ||
384 | 1897 | null_bit, | ||
385 | 1898 | unireg_check, | ||
386 | 1899 | field_name, | ||
387 | 1900 | this); | ||
389 | 1901 | case DRIZZLE_TYPE_TIME: | 1808 | case DRIZZLE_TYPE_TIME: |
390 | 1902 | return new (&mem_root) field::Time(ptr, field_length, null_pos, null_bit, field_name); | 1809 | return new (&mem_root) field::Time(ptr, field_length, null_pos, null_bit, field_name); |
391 | 1903 | case DRIZZLE_TYPE_DATE: | 1810 | case DRIZZLE_TYPE_DATE: |
392 | @@ -1916,5 +1823,4 @@ | |||
393 | 1916 | version= g_refresh_version; | 1823 | version= g_refresh_version; |
394 | 1917 | } | 1824 | } |
395 | 1918 | 1825 | ||
396 | 1919 | |||
397 | 1920 | } /* namespace drizzled */ | 1826 | } /* namespace drizzled */ |
Style-wise, we use {} in all cases. This patch removes that in a few cases.
This is for readability.