Merge lp:~brianaker/drizzle/timestamp into lp:drizzle/7.0
- timestamp
- Merge into 7.0
Proposed by
Brian Aker
Status: | Merged |
---|---|
Approved by: | Brian Aker |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2123 |
Proposed branch: | lp:~brianaker/drizzle/timestamp |
Merge into: | lp:drizzle/7.0 |
Diff against target: |
711 lines (+144/-120) 18 files modified
drizzled/error.cc (+6/-2) drizzled/error_t.h (+3/-0) drizzled/field/date.cc (+4/-3) drizzled/field/time.cc (+38/-40) drizzled/function/time/typecast.h (+10/-3) drizzled/type/time.h (+1/-0) plugin/transaction_log/tests/r/transaction_log_data_type.result (+4/-4) plugin/transaction_log/tests/t/transaction_log_data_type.test (+9/-9) tests/r/func_time.result (+1/-1) tests/r/select.result (+1/-1) tests/r/type_date.result (+2/-2) tests/r/type_datetime.result (+2/-2) tests/suite/time_type/r/basic.result (+35/-35) tests/suite/time_type/t/basic.test (+14/-12) tests/t/func_time.test (+9/-1) tests/t/select.test (+1/-1) tests/t/type_date.test (+2/-2) tests/t/type_datetime.test (+2/-2) |
To merge this branch: | bzr merge lp:~brianaker/drizzle/timestamp |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Drizzle Developers | Pending | ||
Review via email: mp+47718@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
lp:~brianaker/drizzle/timestamp
updated
- 2123. By Lee Bieber
-
Merge Patrick - fix bug 708879: dbqp.py --suite option should handle comma-separated list
Merge Brian - more timestamp updates and fixes
Merge Patrick - fix bug 708861: dbqp.py not running on freebsd
Merge Patrick - Added license text to dbqp-related files
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'drizzled/error.cc' | |||
2 | --- drizzled/error.cc 2011-01-25 07:24:41 +0000 | |||
3 | +++ drizzled/error.cc 2011-01-27 20:14:35 +0000 | |||
4 | @@ -473,10 +473,14 @@ | |||
5 | 473 | ADD_ERROR_MESSAGE(ER_WRONG_PARAMETERS_TO_NATIVE_FCT, N_("Incorrect parameters in the call to native function '%-.192s'")); | 473 | ADD_ERROR_MESSAGE(ER_WRONG_PARAMETERS_TO_NATIVE_FCT, N_("Incorrect parameters in the call to native function '%-.192s'")); |
6 | 474 | ADD_ERROR_MESSAGE(ER_DUP_ENTRY_WITH_KEY_NAME, N_("Duplicate entry '%-.64s' for key '%-.192s'")); | 474 | ADD_ERROR_MESSAGE(ER_DUP_ENTRY_WITH_KEY_NAME, N_("Duplicate entry '%-.64s' for key '%-.192s'")); |
7 | 475 | ADD_ERROR_MESSAGE(ER_LOAD_DATA_INVALID_COLUMN, N_("Invalid column reference (%-.64s) in LOAD DATA")); | 475 | ADD_ERROR_MESSAGE(ER_LOAD_DATA_INVALID_COLUMN, N_("Invalid column reference (%-.64s) in LOAD DATA")); |
9 | 476 | ADD_ERROR_MESSAGE(ER_INVALID_UNIX_TIMESTAMP_VALUE, N_("Received an invalid value '%s' for a UNIX timestamp.")); | 476 | |
10 | 477 | ADD_ERROR_MESSAGE(ER_INVALID_DATETIME_VALUE, N_("Received an invalid datetime value '%s'.")); | 477 | ADD_ERROR_MESSAGE(ER_INVALID_DATETIME_VALUE, N_("Received an invalid datetime value '%s'.")); |
11 | 478 | ADD_ERROR_MESSAGE(ER_INVALID_DATE_VALUE, N_("Received an invalid DATE value '%s'.")); | ||
12 | 479 | ADD_ERROR_MESSAGE(ER_INVALID_NULL_ARGUMENT, N_("Received a NULL argument for function '%s'.")); | ||
13 | 478 | ADD_ERROR_MESSAGE(ER_INVALID_TIMESTAMP_VALUE, N_("Received an invalid timestamp value '%s'.")); | 480 | ADD_ERROR_MESSAGE(ER_INVALID_TIMESTAMP_VALUE, N_("Received an invalid timestamp value '%s'.")); |
15 | 479 | ADD_ERROR_MESSAGE(ER_INVALID_NULL_ARGUMENT, N_("Received a NULL argument for function '%s'.")); | 481 | ADD_ERROR_MESSAGE(ER_INVALID_TIME_VALUE, N_("Received an invalid TIME value '%s'.")); |
16 | 482 | ADD_ERROR_MESSAGE(ER_INVALID_UNIX_TIMESTAMP_VALUE, N_("Received an invalid value '%s' for a UNIX timestamp.")); | ||
17 | 483 | |||
18 | 480 | ADD_ERROR_MESSAGE(ER_ARGUMENT_OUT_OF_RANGE, N_("Received an out-of-range argument '%s' for function '%s'.")); | 484 | ADD_ERROR_MESSAGE(ER_ARGUMENT_OUT_OF_RANGE, N_("Received an out-of-range argument '%s' for function '%s'.")); |
19 | 481 | ADD_ERROR_MESSAGE(ER_INVALID_ENUM_VALUE, N_("Received an invalid enum value '%s'.")); | 485 | ADD_ERROR_MESSAGE(ER_INVALID_ENUM_VALUE, N_("Received an invalid enum value '%s'.")); |
20 | 482 | ADD_ERROR_MESSAGE(ER_NO_PRIMARY_KEY_ON_REPLICATED_TABLE, N_("Tables which are replicated require a primary key.")); | 486 | ADD_ERROR_MESSAGE(ER_NO_PRIMARY_KEY_ON_REPLICATED_TABLE, N_("Tables which are replicated require a primary key.")); |
21 | 483 | 487 | ||
22 | === modified file 'drizzled/error_t.h' | |||
23 | --- drizzled/error_t.h 2011-01-24 21:11:46 +0000 | |||
24 | +++ drizzled/error_t.h 2011-01-27 20:14:35 +0000 | |||
25 | @@ -860,7 +860,10 @@ | |||
26 | 860 | 860 | ||
27 | 861 | ER_PARSE_ERROR_UNKNOWN, | 861 | ER_PARSE_ERROR_UNKNOWN, |
28 | 862 | ER_INVALID_CAST_TO_BOOLEAN, | 862 | ER_INVALID_CAST_TO_BOOLEAN, |
29 | 863 | ER_INVALID_TIME_VALUE, | ||
30 | 864 | ER_INVALID_DATE_VALUE, | ||
31 | 863 | ER_TRANSACTIONAL_DDL_NOT_SUPPORTED, | 865 | ER_TRANSACTIONAL_DDL_NOT_SUPPORTED, |
32 | 866 | |||
33 | 864 | // Leave ER_INVALID_BOOLEAN_VALUE as LAST, and force people to use tags | 867 | // Leave ER_INVALID_BOOLEAN_VALUE as LAST, and force people to use tags |
34 | 865 | // instead of numbers in error messages in test. | 868 | // instead of numbers in error messages in test. |
35 | 866 | ER_ERROR_LAST= ER_TRANSACTIONAL_DDL_NOT_SUPPORTED | 869 | ER_ERROR_LAST= ER_TRANSACTIONAL_DDL_NOT_SUPPORTED |
36 | 867 | 870 | ||
37 | === modified file 'drizzled/field/date.cc' | |||
38 | --- drizzled/field/date.cc 2011-01-25 05:20:15 +0000 | |||
39 | +++ drizzled/field/date.cc 2011-01-27 20:14:35 +0000 | |||
40 | @@ -74,7 +74,7 @@ | |||
41 | 74 | DateTime temporal; | 74 | DateTime temporal; |
42 | 75 | if (! temporal.from_string(from, (size_t) len)) | 75 | if (! temporal.from_string(from, (size_t) len)) |
43 | 76 | { | 76 | { |
45 | 77 | my_error(ER_INVALID_DATETIME_VALUE, MYF(ME_FATALERROR), from); | 77 | my_error(ER_INVALID_DATE_VALUE, MYF(ME_FATALERROR), from); |
46 | 78 | return 2; | 78 | return 2; |
47 | 79 | } | 79 | } |
48 | 80 | /* Create the stored integer format. @TODO This should go away. Should be up to engine... */ | 80 | /* Create the stored integer format. @TODO This should go away. Should be up to engine... */ |
49 | @@ -94,7 +94,7 @@ | |||
50 | 94 | ss.precision(18); /* 18 places should be fine for error display of double input. */ | 94 | ss.precision(18); /* 18 places should be fine for error display of double input. */ |
51 | 95 | ss << from; ss >> tmp; | 95 | ss << from; ss >> tmp; |
52 | 96 | 96 | ||
54 | 97 | my_error(ER_INVALID_DATETIME_VALUE, MYF(ME_FATALERROR), tmp.c_str()); | 97 | my_error(ER_INVALID_DATE_VALUE, MYF(ME_FATALERROR), tmp.c_str()); |
55 | 98 | return 2; | 98 | return 2; |
56 | 99 | } | 99 | } |
57 | 100 | return Field_date::store((int64_t) rint(from), false); | 100 | return Field_date::store((int64_t) rint(from), false); |
58 | @@ -113,13 +113,14 @@ | |||
59 | 113 | /* Convert the integer to a string using boost::lexical_cast */ | 113 | /* Convert the integer to a string using boost::lexical_cast */ |
60 | 114 | std::string tmp(boost::lexical_cast<std::string>(from)); | 114 | std::string tmp(boost::lexical_cast<std::string>(from)); |
61 | 115 | 115 | ||
63 | 116 | my_error(ER_INVALID_DATETIME_VALUE, MYF(ME_FATALERROR), tmp.c_str()); | 116 | my_error(ER_INVALID_DATE_VALUE, MYF(ME_FATALERROR), tmp.c_str()); |
64 | 117 | return 2; | 117 | return 2; |
65 | 118 | } | 118 | } |
66 | 119 | 119 | ||
67 | 120 | /* Create the stored integer format. @TODO This should go away. Should be up to engine... */ | 120 | /* Create the stored integer format. @TODO This should go away. Should be up to engine... */ |
68 | 121 | uint32_t int_value= (temporal.years() * 10000) + (temporal.months() * 100) + temporal.days(); | 121 | uint32_t int_value= (temporal.years() * 10000) + (temporal.months() * 100) + temporal.days(); |
69 | 122 | int4store(ptr, int_value); | 122 | int4store(ptr, int_value); |
70 | 123 | |||
71 | 123 | return 0; | 124 | return 0; |
72 | 124 | } | 125 | } |
73 | 125 | 126 | ||
74 | 126 | 127 | ||
75 | === modified file 'drizzled/field/time.cc' | |||
76 | --- drizzled/field/time.cc 2011-01-25 05:20:15 +0000 | |||
77 | +++ drizzled/field/time.cc 2011-01-27 20:14:35 +0000 | |||
78 | @@ -82,7 +82,8 @@ | |||
79 | 82 | 82 | ||
80 | 83 | if (not temporal.from_string(from, (size_t) len)) | 83 | if (not temporal.from_string(from, (size_t) len)) |
81 | 84 | { | 84 | { |
83 | 85 | my_error(ER_INVALID_UNIX_TIMESTAMP_VALUE, MYF(ME_FATALERROR), from); | 85 | std::string tmp(boost::lexical_cast<std::string>(from)); |
84 | 86 | my_error(ER_INVALID_TIME_VALUE, MYF(0), tmp.c_str()); | ||
85 | 86 | return 1; | 87 | return 1; |
86 | 87 | } | 88 | } |
87 | 88 | 89 | ||
88 | @@ -94,44 +95,42 @@ | |||
89 | 94 | int Time::store(double from) | 95 | int Time::store(double from) |
90 | 95 | { | 96 | { |
91 | 96 | ASSERT_COLUMN_MARKED_FOR_WRITE; | 97 | ASSERT_COLUMN_MARKED_FOR_WRITE; |
127 | 97 | int64_t tmp; | 98 | |
128 | 98 | int error= 0; | 99 | do |
129 | 99 | 100 | { | |
130 | 100 | if (from > (double)TIME_MAX_VALUE) | 101 | int64_t tmp; |
131 | 101 | { | 102 | |
132 | 102 | tmp= TIME_MAX_VALUE; | 103 | if (from > (double)TIME_MAX_VALUE) |
133 | 103 | set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, | 104 | { |
134 | 104 | ER_WARN_DATA_OUT_OF_RANGE, from, type::DRIZZLE_TIMESTAMP_TIME); | 105 | tmp= TIME_MAX_VALUE; |
135 | 105 | error= 1; | 106 | break; |
136 | 106 | } | 107 | } |
137 | 107 | else if (from < (double) - TIME_MAX_VALUE) | 108 | else if (from < (double) - TIME_MAX_VALUE) |
138 | 108 | { | 109 | { |
139 | 109 | tmp= -TIME_MAX_VALUE; | 110 | tmp= -TIME_MAX_VALUE; |
140 | 110 | set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, | 111 | break; |
141 | 111 | ER_WARN_DATA_OUT_OF_RANGE, from, type::DRIZZLE_TIMESTAMP_TIME); | 112 | } |
142 | 112 | error= 1; | 113 | else |
143 | 113 | } | 114 | { |
144 | 114 | else | 115 | tmp=(long) floor(fabs(from)); // Remove fractions |
145 | 115 | { | 116 | |
146 | 116 | tmp=(long) floor(fabs(from)); // Remove fractions | 117 | if (from < 0) |
147 | 117 | 118 | tmp= -tmp; | |
148 | 118 | if (from < 0) | 119 | |
149 | 119 | tmp= -tmp; | 120 | if (tmp % 100 > 59 || tmp/100 % 100 > 59) |
150 | 120 | 121 | { | |
151 | 121 | if (tmp % 100 > 59 || tmp/100 % 100 > 59) | 122 | break; |
152 | 122 | { | 123 | } |
153 | 123 | tmp=0; | 124 | } |
154 | 124 | set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, | 125 | |
120 | 125 | ER_WARN_DATA_OUT_OF_RANGE, from, | ||
121 | 126 | type::DRIZZLE_TIMESTAMP_TIME); | ||
122 | 127 | error= 1; | ||
123 | 128 | } | ||
124 | 129 | } | ||
125 | 130 | |||
126 | 131 | if (not error) | ||
155 | 132 | return store(tmp, false); | 126 | return store(tmp, false); |
156 | 133 | 127 | ||
158 | 134 | return error; | 128 | } while (0); |
159 | 129 | |||
160 | 130 | std::string tmp(boost::lexical_cast<std::string>(from)); | ||
161 | 131 | my_error(ER_INVALID_TIME_VALUE, MYF(0), tmp.c_str()); | ||
162 | 132 | |||
163 | 133 | return 1; | ||
164 | 135 | } | 134 | } |
165 | 136 | 135 | ||
166 | 137 | int Time::store(int64_t from, bool) | 136 | int Time::store(int64_t from, bool) |
167 | @@ -143,12 +142,11 @@ | |||
168 | 143 | * if unable to create a valid DateTime. | 142 | * if unable to create a valid DateTime. |
169 | 144 | */ | 143 | */ |
170 | 145 | drizzled::Time temporal; | 144 | drizzled::Time temporal; |
172 | 146 | if (! temporal.from_time_t(from)) | 145 | if (not temporal.from_time_t(from)) |
173 | 147 | { | 146 | { |
174 | 148 | /* Convert the integer to a string using boost::lexical_cast */ | 147 | /* Convert the integer to a string using boost::lexical_cast */ |
175 | 149 | std::string tmp(boost::lexical_cast<std::string>(from)); | 148 | std::string tmp(boost::lexical_cast<std::string>(from)); |
178 | 150 | 149 | my_error(ER_INVALID_TIME_VALUE, MYF(0), tmp.c_str()); | |
177 | 151 | my_error(ER_INVALID_UNIX_TIMESTAMP_VALUE, MYF(ME_FATALERROR), tmp.c_str()); | ||
179 | 152 | return 2; | 150 | return 2; |
180 | 153 | } | 151 | } |
181 | 154 | 152 | ||
182 | 155 | 153 | ||
183 | === modified file 'drizzled/function/time/typecast.h' | |||
184 | --- drizzled/function/time/typecast.h 2011-01-25 05:20:15 +0000 | |||
185 | +++ drizzled/function/time/typecast.h 2011-01-27 20:14:35 +0000 | |||
186 | @@ -87,33 +87,40 @@ | |||
187 | 87 | public: | 87 | public: |
188 | 88 | using Item_func::tmp_table_field; | 88 | using Item_func::tmp_table_field; |
189 | 89 | 89 | ||
191 | 90 | Item_date_typecast(Item *a) :Item_typecast_maybe_null(a) {} | 90 | Item_date_typecast(Item *a) : |
192 | 91 | Item_typecast_maybe_null(a) | ||
193 | 92 | {} | ||
194 | 93 | |||
195 | 91 | const char *func_name() const { return "cast_as_date"; } | 94 | const char *func_name() const { return "cast_as_date"; } |
196 | 92 | String *val_str(String *str); | 95 | String *val_str(String *str); |
197 | 93 | bool get_date(type::Time <ime, uint32_t fuzzy_date); | 96 | bool get_date(type::Time <ime, uint32_t fuzzy_date); |
198 | 94 | bool get_time(type::Time <ime); | 97 | bool get_time(type::Time <ime); |
199 | 95 | const char *cast_type() const { return "date"; } | 98 | const char *cast_type() const { return "date"; } |
200 | 96 | enum_field_types field_type() const { return DRIZZLE_TYPE_DATE; } | 99 | enum_field_types field_type() const { return DRIZZLE_TYPE_DATE; } |
201 | 100 | |||
202 | 97 | Field *tmp_table_field(Table *table) | 101 | Field *tmp_table_field(Table *table) |
203 | 98 | { | 102 | { |
204 | 99 | return tmp_table_field_from_field_type(table, 0); | 103 | return tmp_table_field_from_field_type(table, 0); |
205 | 100 | } | 104 | } |
206 | 105 | |||
207 | 101 | void fix_length_and_dec() | 106 | void fix_length_and_dec() |
208 | 102 | { | 107 | { |
209 | 103 | collation.set(&my_charset_bin); | 108 | collation.set(&my_charset_bin); |
210 | 104 | max_length= 10; | 109 | max_length= 10; |
211 | 105 | maybe_null= 1; | 110 | maybe_null= 1; |
212 | 106 | } | 111 | } |
213 | 112 | |||
214 | 107 | bool result_as_int64_t() { return true; } | 113 | bool result_as_int64_t() { return true; } |
215 | 108 | int64_t val_int(); | 114 | int64_t val_int(); |
216 | 109 | double val_real() { return (double) val_int(); } | 115 | double val_real() { return (double) val_int(); } |
217 | 116 | |||
218 | 110 | type::Decimal *val_decimal(type::Decimal *decimal_value) | 117 | type::Decimal *val_decimal(type::Decimal *decimal_value) |
219 | 111 | { | 118 | { |
220 | 112 | assert(fixed == 1); | 119 | assert(fixed == 1); |
221 | 113 | return val_decimal_from_date(decimal_value); | 120 | return val_decimal_from_date(decimal_value); |
222 | 114 | } | 121 | } |
225 | 115 | int save_in_field(Field *field, | 122 | |
226 | 116 | bool ) | 123 | int save_in_field(Field *field, bool ) |
227 | 117 | { | 124 | { |
228 | 118 | return save_date_in_field(field); | 125 | return save_date_in_field(field); |
229 | 119 | } | 126 | } |
230 | 120 | 127 | ||
231 | === modified file 'drizzled/type/time.h' | |||
232 | --- drizzled/type/time.h 2011-01-25 05:20:15 +0000 | |||
233 | +++ drizzled/type/time.h 2011-01-27 20:14:35 +0000 | |||
234 | @@ -102,6 +102,7 @@ | |||
235 | 102 | datatime_t while being stored in an integer is actually a formatted value. | 102 | datatime_t while being stored in an integer is actually a formatted value. |
236 | 103 | */ | 103 | */ |
237 | 104 | typedef int64_t datetime_t; | 104 | typedef int64_t datetime_t; |
238 | 105 | typedef int64_t date_t; | ||
239 | 105 | 106 | ||
240 | 106 | inline bool is_valid(const datetime_t &value) | 107 | inline bool is_valid(const datetime_t &value) |
241 | 107 | { | 108 | { |
242 | 108 | 109 | ||
243 | === modified file 'plugin/transaction_log/tests/r/transaction_log_data_type.result' | |||
244 | --- plugin/transaction_log/tests/r/transaction_log_data_type.result 2011-01-20 06:31:31 +0000 | |||
245 | +++ plugin/transaction_log/tests/r/transaction_log_data_type.result 2011-01-27 20:14:35 +0000 | |||
246 | @@ -2356,7 +2356,7 @@ | |||
247 | 2356 | 2356 | ||
248 | 2357 | Testing MIN-1 DATE | 2357 | Testing MIN-1 DATE |
249 | 2358 | INSERT INTO t1 (b) VALUES('0000-12-31'); | 2358 | INSERT INTO t1 (b) VALUES('0000-12-31'); |
251 | 2359 | ERROR HY000: Received an invalid datetime value '0000-12-31'. | 2359 | ERROR HY000: Received an invalid DATE value '0000-12-31'. |
252 | 2360 | Check transaction_log_entries | 2360 | Check transaction_log_entries |
253 | 2361 | SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES; | 2361 | SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES; |
254 | 2362 | COUNT(*) | 2362 | COUNT(*) |
255 | @@ -2411,7 +2411,7 @@ | |||
256 | 2411 | 2411 | ||
257 | 2412 | Testing MAX+1 DATE | 2412 | Testing MAX+1 DATE |
258 | 2413 | INSERT INTO t1 (b) VALUES('10000-01-01'); | 2413 | INSERT INTO t1 (b) VALUES('10000-01-01'); |
260 | 2414 | ERROR HY000: Received an invalid datetime value '10000-01-01'. | 2414 | ERROR HY000: Received an invalid DATE value '10000-01-01'. |
261 | 2415 | Check transaction_log_entries | 2415 | Check transaction_log_entries |
262 | 2416 | SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES; | 2416 | SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES; |
263 | 2417 | COUNT(*) | 2417 | COUNT(*) |
264 | @@ -2628,7 +2628,7 @@ | |||
265 | 2628 | 2628 | ||
266 | 2629 | Testing BAD INPUT DATE1 | 2629 | Testing BAD INPUT DATE1 |
267 | 2630 | INSERT INTO t1 (b) VALUES('abbazabba'); | 2630 | INSERT INTO t1 (b) VALUES('abbazabba'); |
269 | 2631 | ERROR HY000: Received an invalid datetime value 'abbazabba'. | 2631 | ERROR HY000: Received an invalid DATE value 'abbazabba'. |
270 | 2632 | Check transaction_log_entries | 2632 | Check transaction_log_entries |
271 | 2633 | SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES; | 2633 | SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES; |
272 | 2634 | COUNT(*) | 2634 | COUNT(*) |
273 | @@ -2683,7 +2683,7 @@ | |||
274 | 2683 | 2683 | ||
275 | 2684 | Testing BAD INPUT DATE2 | 2684 | Testing BAD INPUT DATE2 |
276 | 2685 | INSERT INTO t1 (b) VALUES('a'); | 2685 | INSERT INTO t1 (b) VALUES('a'); |
278 | 2686 | ERROR HY000: Received an invalid datetime value 'a'. | 2686 | ERROR HY000: Received an invalid DATE value 'a'. |
279 | 2687 | Check transaction_log_entries | 2687 | Check transaction_log_entries |
280 | 2688 | SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES; | 2688 | SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES; |
281 | 2689 | COUNT(*) | 2689 | COUNT(*) |
282 | 2690 | 2690 | ||
283 | === modified file 'plugin/transaction_log/tests/t/transaction_log_data_type.test' | |||
284 | --- plugin/transaction_log/tests/t/transaction_log_data_type.test 2011-01-20 06:31:31 +0000 | |||
285 | +++ plugin/transaction_log/tests/t/transaction_log_data_type.test 2011-01-27 20:14:35 +0000 | |||
286 | @@ -340,13 +340,13 @@ | |||
287 | 340 | --echo | 340 | --echo |
288 | 341 | 341 | ||
289 | 342 | --echo Testing MIN-1 DATE | 342 | --echo Testing MIN-1 DATE |
291 | 343 | --ERROR 1686 | 343 | --ERROR ER_INVALID_DATE_VALUE |
292 | 344 | INSERT INTO t1 (b) VALUES('0000-12-31'); | 344 | INSERT INTO t1 (b) VALUES('0000-12-31'); |
293 | 345 | --source ../plugin/transaction_log/tests/t/check_transaction_log.inc | 345 | --source ../plugin/transaction_log/tests/t/check_transaction_log.inc |
294 | 346 | --echo | 346 | --echo |
295 | 347 | 347 | ||
296 | 348 | --echo Testing MAX+1 DATE | 348 | --echo Testing MAX+1 DATE |
298 | 349 | --ERROR 1686 | 349 | --ERROR ER_INVALID_DATE_VALUE |
299 | 350 | INSERT INTO t1 (b) VALUES('10000-01-01'); | 350 | INSERT INTO t1 (b) VALUES('10000-01-01'); |
300 | 351 | --source ../plugin/transaction_log/tests/t/check_transaction_log.inc | 351 | --source ../plugin/transaction_log/tests/t/check_transaction_log.inc |
301 | 352 | --echo | 352 | --echo |
302 | @@ -367,13 +367,13 @@ | |||
303 | 367 | --echo | 367 | --echo |
304 | 368 | 368 | ||
305 | 369 | --echo Testing BAD INPUT DATE1 | 369 | --echo Testing BAD INPUT DATE1 |
307 | 370 | --ERROR 1686 | 370 | --ERROR ER_INVALID_DATE_VALUE |
308 | 371 | INSERT INTO t1 (b) VALUES('abbazabba'); | 371 | INSERT INTO t1 (b) VALUES('abbazabba'); |
309 | 372 | --source ../plugin/transaction_log/tests/t/check_transaction_log.inc | 372 | --source ../plugin/transaction_log/tests/t/check_transaction_log.inc |
310 | 373 | --echo | 373 | --echo |
311 | 374 | 374 | ||
312 | 375 | --echo Testing BAD INPUT DATE2 | 375 | --echo Testing BAD INPUT DATE2 |
314 | 376 | --ERROR 1686 | 376 | --ERROR ER_INVALID_DATE_VALUE |
315 | 377 | INSERT INTO t1 (b) VALUES('a'); | 377 | INSERT INTO t1 (b) VALUES('a'); |
316 | 378 | --source ../plugin/transaction_log/tests/t/check_transaction_log.inc | 378 | --source ../plugin/transaction_log/tests/t/check_transaction_log.inc |
317 | 379 | --echo | 379 | --echo |
318 | @@ -402,13 +402,13 @@ | |||
319 | 402 | --echo | 402 | --echo |
320 | 403 | 403 | ||
321 | 404 | --echo Testing MIN-1 DATETIME | 404 | --echo Testing MIN-1 DATETIME |
323 | 405 | --ERROR 1686 | 405 | --ERROR ER_INVALID_DATETIME_VALUE |
324 | 406 | INSERT INTO t1 (b) VALUES('0000-01-01'); | 406 | INSERT INTO t1 (b) VALUES('0000-01-01'); |
325 | 407 | --source ../plugin/transaction_log/tests/t/check_transaction_log.inc | 407 | --source ../plugin/transaction_log/tests/t/check_transaction_log.inc |
326 | 408 | --echo | 408 | --echo |
327 | 409 | 409 | ||
328 | 410 | --echo Testing MAX+1 DATETIME | 410 | --echo Testing MAX+1 DATETIME |
330 | 411 | --ERROR 1686 | 411 | --ERROR ER_INVALID_DATETIME_VALUE |
331 | 412 | INSERT INTO t1 (b) VALUES('10000-01-01'); | 412 | INSERT INTO t1 (b) VALUES('10000-01-01'); |
332 | 413 | --source ../plugin/transaction_log/tests/t/check_transaction_log.inc | 413 | --source ../plugin/transaction_log/tests/t/check_transaction_log.inc |
333 | 414 | --echo | 414 | --echo |
334 | @@ -429,19 +429,19 @@ | |||
335 | 429 | --echo | 429 | --echo |
336 | 430 | 430 | ||
337 | 431 | --echo Testing BAD INPUT DATETIME1 | 431 | --echo Testing BAD INPUT DATETIME1 |
339 | 432 | --ERROR 1686 | 432 | --ERROR ER_INVALID_DATETIME_VALUE |
340 | 433 | INSERT INTO t1 (b) VALUES('2000-01-01 25:00:00'); | 433 | INSERT INTO t1 (b) VALUES('2000-01-01 25:00:00'); |
341 | 434 | --source ../plugin/transaction_log/tests/t/check_transaction_log.inc | 434 | --source ../plugin/transaction_log/tests/t/check_transaction_log.inc |
342 | 435 | --echo | 435 | --echo |
343 | 436 | 436 | ||
344 | 437 | --echo Testing BAD INPUT DATETIME2 | 437 | --echo Testing BAD INPUT DATETIME2 |
346 | 438 | --ERROR 1686 | 438 | --ERROR ER_INVALID_DATETIME_VALUE |
347 | 439 | INSERT INTO t1 (b) VALUES('2000-01-01 12:60:00'); | 439 | INSERT INTO t1 (b) VALUES('2000-01-01 12:60:00'); |
348 | 440 | --source ../plugin/transaction_log/tests/t/check_transaction_log.inc | 440 | --source ../plugin/transaction_log/tests/t/check_transaction_log.inc |
349 | 441 | --echo | 441 | --echo |
350 | 442 | 442 | ||
351 | 443 | --echo Testing BAD INPUT DATETIME3 | 443 | --echo Testing BAD INPUT DATETIME3 |
353 | 444 | --ERROR 1686 | 444 | --ERROR ER_INVALID_DATETIME_VALUE |
354 | 445 | INSERT INTO t1 (b) VALUES('2000-01-01 12:00:70'); | 445 | INSERT INTO t1 (b) VALUES('2000-01-01 12:00:70'); |
355 | 446 | --source ../plugin/transaction_log/tests/t/check_transaction_log.inc | 446 | --source ../plugin/transaction_log/tests/t/check_transaction_log.inc |
356 | 447 | --echo | 447 | --echo |
357 | 448 | 448 | ||
358 | === modified file 'tests/r/func_time.result' | |||
359 | --- tests/r/func_time.result 2011-01-20 06:31:31 +0000 | |||
360 | +++ tests/r/func_time.result 2011-01-27 20:14:35 +0000 | |||
361 | @@ -348,7 +348,7 @@ | |||
362 | 348 | create table t1 (d date, dt datetime, t timestamp, c char(10)); | 348 | create table t1 (d date, dt datetime, t timestamp, c char(10)); |
363 | 349 | insert into t1 values (null, null, null, null); | 349 | insert into t1 values (null, null, null, null); |
364 | 350 | insert into t1 values ("0000-00-00", "0000-00-00", "0000-00-00", "0000-00-00"); | 350 | insert into t1 values ("0000-00-00", "0000-00-00", "0000-00-00", "0000-00-00"); |
366 | 351 | ERROR HY000: Received an invalid datetime value '0000-00-00'. | 351 | ERROR HY000: Received an invalid DATE value '0000-00-00'. |
367 | 352 | select dayofyear("0000-00-00"),dayofyear(d),dayofyear(dt),dayofyear(t),dayofyear(c) from t1; | 352 | select dayofyear("0000-00-00"),dayofyear(d),dayofyear(dt),dayofyear(t),dayofyear(c) from t1; |
368 | 353 | ERROR HY000: Received an invalid datetime value '0000-00-00'. | 353 | ERROR HY000: Received an invalid datetime value '0000-00-00'. |
369 | 354 | select dayofmonth("0000-00-00"),dayofmonth(d),dayofmonth(dt),dayofmonth(t),dayofmonth(c) from t1; | 354 | select dayofmonth("0000-00-00"),dayofmonth(d),dayofmonth(dt),dayofmonth(t),dayofmonth(c) from t1; |
370 | 355 | 355 | ||
371 | === modified file 'tests/r/select.result' | |||
372 | --- tests/r/select.result 2010-12-02 06:58:45 +0000 | |||
373 | +++ tests/r/select.result 2011-01-27 20:14:35 +0000 | |||
374 | @@ -2818,7 +2818,7 @@ | |||
375 | 2818 | insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'), | 2818 | insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'), |
376 | 2819 | (4,'2005-10-01'),(5,'2005-12-30'); | 2819 | (4,'2005-10-01'),(5,'2005-12-30'); |
377 | 2820 | select * from t1 where f2 >= 0 order by f2; | 2820 | select * from t1 where f2 >= 0 order by f2; |
379 | 2821 | ERROR HY000: Received an invalid datetime value '0'. | 2821 | ERROR HY000: Received an invalid DATE value '0'. |
380 | 2822 | select * from t1 where f2 >= '0000-00-00' order by f2; | 2822 | select * from t1 where f2 >= '0000-00-00' order by f2; |
381 | 2823 | ERROR HY000: Received an invalid datetime value '0000-00-00'. | 2823 | ERROR HY000: Received an invalid datetime value '0000-00-00'. |
382 | 2824 | select * from t1 where f2 >= '2005-09-31' order by f2; | 2824 | select * from t1 where f2 >= '2005-09-31' order by f2; |
383 | 2825 | 2825 | ||
384 | === modified file 'tests/r/type_date.result' | |||
385 | --- tests/r/type_date.result 2009-02-21 16:00:06 +0000 | |||
386 | +++ tests/r/type_date.result 2011-01-27 20:14:35 +0000 | |||
387 | @@ -112,10 +112,10 @@ | |||
388 | 112 | @d:=1311 | 112 | @d:=1311 |
389 | 113 | 1311 | 113 | 1311 |
390 | 114 | select year(@d), month(@d), day(@d), cast(@d as date); | 114 | select year(@d), month(@d), day(@d), cast(@d as date); |
392 | 115 | ERROR HY000: Received an invalid datetime value '1311'. | 115 | Got one of the listed errors |
393 | 116 | create table t1 (d date , dt datetime , ts timestamp); | 116 | create table t1 (d date , dt datetime , ts timestamp); |
394 | 117 | insert into t1 values (9912101,9912101,9912101); | 117 | insert into t1 values (9912101,9912101,9912101); |
396 | 118 | ERROR HY000: Received an invalid datetime value '9912101'. | 118 | ERROR HY000: Received an invalid DATE value '9912101'. |
397 | 119 | insert into t1 values (11111,11111,11111); | 119 | insert into t1 values (11111,11111,11111); |
398 | 120 | select * from t1; | 120 | select * from t1; |
399 | 121 | d dt ts | 121 | d dt ts |
400 | 122 | 122 | ||
401 | === modified file 'tests/r/type_datetime.result' | |||
402 | --- tests/r/type_datetime.result 2011-01-18 00:08:34 +0000 | |||
403 | +++ tests/r/type_datetime.result 2011-01-27 20:14:35 +0000 | |||
404 | @@ -187,7 +187,7 @@ | |||
405 | 187 | insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38'); | 187 | insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38'); |
406 | 188 | insert into t1 set dt='2007-03-23 13:49:38',da=dt; | 188 | insert into t1 set dt='2007-03-23 13:49:38',da=dt; |
407 | 189 | insert into t1 values ('2007-03-32','2007-03-23 13:49:38'); | 189 | insert into t1 values ('2007-03-32','2007-03-23 13:49:38'); |
409 | 190 | ERROR HY000: Received an invalid datetime value '2007-03-32'. | 190 | ERROR HY000: Received an invalid DATE value '2007-03-32'. |
410 | 191 | select * from t1; | 191 | select * from t1; |
411 | 192 | da dt | 192 | da dt |
412 | 193 | 1962-03-03 1962-03-03 00:00:00 | 193 | 1962-03-03 1962-03-03 00:00:00 |
413 | @@ -457,7 +457,7 @@ | |||
414 | 457 | insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38'); | 457 | insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38'); |
415 | 458 | insert into t1 set dt='2007-03-23 13:49:38',da=dt; | 458 | insert into t1 set dt='2007-03-23 13:49:38',da=dt; |
416 | 459 | insert into t1 values ('2007-03-32','2007-03-23 13:49:38'); | 459 | insert into t1 values ('2007-03-32','2007-03-23 13:49:38'); |
418 | 460 | ERROR HY000: Received an invalid datetime value '2007-03-32'. | 460 | ERROR HY000: Received an invalid DATE value '2007-03-32'. |
419 | 461 | select * from t1; | 461 | select * from t1; |
420 | 462 | da dt | 462 | da dt |
421 | 463 | 1962-03-03 1962-03-03 00:00:00 | 463 | 1962-03-03 1962-03-03 00:00:00 |
422 | 464 | 464 | ||
423 | === modified file 'tests/suite/time_type/r/basic.result' | |||
424 | --- tests/suite/time_type/r/basic.result 2010-12-22 17:43:15 +0000 | |||
425 | +++ tests/suite/time_type/r/basic.result 2011-01-27 20:14:35 +0000 | |||
426 | @@ -6,15 +6,15 @@ | |||
427 | 6 | INSERT INTO t1 VALUES (1234); | 6 | INSERT INTO t1 VALUES (1234); |
428 | 7 | INSERT INTO t1 VALUES (123456.78); | 7 | INSERT INTO t1 VALUES (123456.78); |
429 | 8 | INSERT INTO t1 VALUES (1234559.99); | 8 | INSERT INTO t1 VALUES (1234559.99); |
431 | 9 | ERROR HY000: Received an invalid value '1234559.99' for a UNIX timestamp. | 9 | ERROR HY000: Received an invalid TIME value '1234559.99'. |
432 | 10 | INSERT INTO t1 VALUES ("1"); | 10 | INSERT INTO t1 VALUES ("1"); |
433 | 11 | INSERT INTO t1 VALUES ("1:23"); | 11 | INSERT INTO t1 VALUES ("1:23"); |
434 | 12 | INSERT INTO t1 VALUES ("1:23:45"); | 12 | INSERT INTO t1 VALUES ("1:23:45"); |
435 | 13 | INSERT INTO t1 VALUES ("10.22"); | 13 | INSERT INTO t1 VALUES ("10.22"); |
436 | 14 | INSERT INTO t1 VALUES ("20 10:22:33"); | 14 | INSERT INTO t1 VALUES ("20 10:22:33"); |
438 | 15 | ERROR HY000: Received an invalid value '20 10:22:33' for a UNIX timestamp. | 15 | ERROR HY000: Received an invalid TIME value '20 10:22:33'. |
439 | 16 | INSERT INTO t1 VALUES ("-10 1:22:33.45"); | 16 | INSERT INTO t1 VALUES ("-10 1:22:33.45"); |
441 | 17 | ERROR HY000: Received an invalid value '-10 1:22:33.45' for a UNIX timestamp. | 17 | ERROR HY000: Received an invalid TIME value '-10 1:22:33.45'. |
442 | 18 | INSERT INTO t1 VALUES ("1999-02-03 20:33:34"); | 18 | INSERT INTO t1 VALUES ("1999-02-03 20:33:34"); |
443 | 19 | insert t1 values (30); | 19 | insert t1 values (30); |
444 | 20 | insert t1 values (1230); | 20 | insert t1 values (1230); |
445 | @@ -22,52 +22,52 @@ | |||
446 | 22 | insert t1 values ("12:30"); | 22 | insert t1 values ("12:30"); |
447 | 23 | insert t1 values ("12:30:35"); | 23 | insert t1 values ("12:30:35"); |
448 | 24 | insert t1 values ("1 12:30:31.32"); | 24 | insert t1 values ("1 12:30:31.32"); |
451 | 25 | ERROR HY000: Received an invalid value '1 12:30:31.32' for a UNIX timestamp. | 25 | ERROR HY000: Received an invalid TIME value '1 12:30:31.32'. |
452 | 26 | select * from t1; | 26 | select t from t1; |
453 | 27 | t | 27 | t |
454 | 28 | 10:22:33 | ||
455 | 29 | 12:34:56 | ||
456 | 30 | 00:00:10 | ||
457 | 31 | 00:20:34 | ||
458 | 32 | 12:34:56 | ||
459 | 33 | 00:00:01 | 28 | 00:00:01 |
460 | 29 | 00:00:10 | ||
461 | 30 | 00:00:10 | ||
462 | 31 | 00:00:30 | ||
463 | 34 | 00:01:23 | 32 | 00:01:23 |
464 | 33 | 00:12:30 | ||
465 | 34 | 00:12:30 | ||
466 | 35 | 00:20:30 | ||
467 | 36 | 00:20:34 | ||
468 | 35 | 01:23:45 | 37 | 01:23:45 |
470 | 36 | 00:00:10 | 38 | 10:22:33 |
471 | 39 | 12:30:35 | ||
472 | 40 | 12:34:56 | ||
473 | 41 | 12:34:56 | ||
474 | 37 | 20:33:34 | 42 | 20:33:34 |
475 | 38 | 00:00:30 | ||
476 | 39 | 00:20:30 | ||
477 | 40 | 00:12:30 | ||
478 | 41 | 00:12:30 | ||
479 | 42 | 12:30:35 | ||
480 | 43 | INSERT INTO t1 VALUES ("10.22.22"); | 43 | INSERT INTO t1 VALUES ("10.22.22"); |
482 | 44 | ERROR HY000: Received an invalid value '10.22.22' for a UNIX timestamp. | 44 | ERROR HY000: Received an invalid TIME value '10.22.22'. |
483 | 45 | INSERT INTO t1 VALUES (1234567); | 45 | INSERT INTO t1 VALUES (1234567); |
484 | 46 | INSERT INTO t1 VALUES (123456789); | 46 | INSERT INTO t1 VALUES (123456789); |
485 | 47 | INSERT INTO t1 VALUES (123456789.10); | 47 | INSERT INTO t1 VALUES (123456789.10); |
487 | 48 | ERROR HY000: Received an invalid value '123456789.10' for a UNIX timestamp. | 48 | ERROR HY000: Received an invalid TIME value '123456789.10'. |
488 | 49 | INSERT INTO t1 VALUES ("10 22:22"); | 49 | INSERT INTO t1 VALUES ("10 22:22"); |
490 | 50 | ERROR HY000: Received an invalid value '10 22:22' for a UNIX timestamp. | 50 | ERROR HY000: Received an invalid TIME value '10 22:22'. |
491 | 51 | INSERT INTO t1 VALUES ("12.45a"); | 51 | INSERT INTO t1 VALUES ("12.45a"); |
494 | 52 | ERROR HY000: Received an invalid value '12.45a' for a UNIX timestamp. | 52 | ERROR HY000: Received an invalid TIME value '12.45a'. |
495 | 53 | select * from t1; | 53 | select t from t1; |
496 | 54 | t | 54 | t |
497 | 55 | 10:22:33 | ||
498 | 56 | 12:34:56 | ||
499 | 57 | 00:00:10 | ||
500 | 58 | 00:20:34 | ||
501 | 59 | 12:34:56 | ||
502 | 60 | 00:00:01 | 55 | 00:00:01 |
503 | 56 | 00:00:10 | ||
504 | 57 | 00:00:10 | ||
505 | 58 | 00:00:30 | ||
506 | 61 | 00:01:23 | 59 | 00:01:23 |
507 | 60 | 00:12:30 | ||
508 | 61 | 00:12:30 | ||
509 | 62 | 00:20:30 | ||
510 | 63 | 00:20:34 | ||
511 | 62 | 01:23:45 | 64 | 01:23:45 |
512 | 63 | 00:00:10 | ||
513 | 64 | 20:33:34 | ||
514 | 65 | 00:00:30 | ||
515 | 66 | 00:20:30 | ||
516 | 67 | 00:12:30 | ||
517 | 68 | 00:12:30 | ||
518 | 69 | 12:30:35 | ||
519 | 70 | 06:56:07 | 65 | 06:56:07 |
520 | 66 | 10:22:33 | ||
521 | 67 | 12:30:35 | ||
522 | 68 | 12:34:56 | ||
523 | 69 | 12:34:56 | ||
524 | 70 | 20:33:34 | ||
525 | 71 | 21:33:09 | 71 | 21:33:09 |
526 | 72 | DROP TABLE t1; | 72 | DROP TABLE t1; |
527 | 73 | CREATE TABLE t1 (t time); | 73 | CREATE TABLE t1 (t time); |
528 | @@ -106,14 +106,14 @@ | |||
529 | 106 | 1 | 106 | 1 |
530 | 107 | CREATE TABLE t1 (f1 time); | 107 | CREATE TABLE t1 (f1 time); |
531 | 108 | INSERT INTO t1 VALUES ('24:00:00'); | 108 | INSERT INTO t1 VALUES ('24:00:00'); |
533 | 109 | ERROR HY000: Received an invalid value '24:00:00' for a UNIX timestamp. | 109 | ERROR HY000: Received an invalid TIME value '24:00:00'. |
534 | 110 | SELECT CAST('24:00:00' as time) = (select f1 from t1); | 110 | SELECT CAST('24:00:00' as time) = (select f1 from t1); |
535 | 111 | CAST('24:00:00' as time) = (select f1 from t1) | 111 | CAST('24:00:00' as time) = (select f1 from t1) |
536 | 112 | NULL | 112 | NULL |
537 | 113 | DROP TABLE t1; | 113 | DROP TABLE t1; |
538 | 114 | CREATE TABLE t1(f1 time, f2 time); | 114 | CREATE TABLE t1(f1 time, f2 time); |
539 | 115 | INSERT INTO t1 VALUES('20:00:00','150:00:00'); | 115 | INSERT INTO t1 VALUES('20:00:00','150:00:00'); |
541 | 116 | ERROR HY000: Received an invalid value '150:00:00' for a UNIX timestamp. | 116 | ERROR HY000: Received an invalid TIME value '150:00:00'. |
542 | 117 | select 1 from t1 where cast('100:00:00' as time) between f1 and f2; | 117 | select 1 from t1 where cast('100:00:00' as time) between f1 and f2; |
543 | 118 | 1 | 118 | 1 |
544 | 119 | DROP TABLE t1; | 119 | DROP TABLE t1; |
545 | 120 | 120 | ||
546 | === modified file 'tests/suite/time_type/t/basic.test' | |||
547 | --- tests/suite/time_type/t/basic.test 2010-12-22 17:43:15 +0000 | |||
548 | +++ tests/suite/time_type/t/basic.test 2011-01-27 20:14:35 +0000 | |||
549 | @@ -16,7 +16,7 @@ | |||
550 | 16 | 16 | ||
551 | 17 | INSERT INTO t1 VALUES (123456.78); | 17 | INSERT INTO t1 VALUES (123456.78); |
552 | 18 | 18 | ||
554 | 19 | --error ER_INVALID_UNIX_TIMESTAMP_VALUE | 19 | --error ER_INVALID_TIME_VALUE |
555 | 20 | INSERT INTO t1 VALUES (1234559.99); | 20 | INSERT INTO t1 VALUES (1234559.99); |
556 | 21 | 21 | ||
557 | 22 | INSERT INTO t1 VALUES ("1"); | 22 | INSERT INTO t1 VALUES ("1"); |
558 | @@ -27,10 +27,10 @@ | |||
559 | 27 | 27 | ||
560 | 28 | INSERT INTO t1 VALUES ("10.22"); | 28 | INSERT INTO t1 VALUES ("10.22"); |
561 | 29 | 29 | ||
563 | 30 | --error ER_INVALID_UNIX_TIMESTAMP_VALUE | 30 | --error ER_INVALID_TIME_VALUE |
564 | 31 | INSERT INTO t1 VALUES ("20 10:22:33"); | 31 | INSERT INTO t1 VALUES ("20 10:22:33"); |
565 | 32 | 32 | ||
567 | 33 | --error ER_INVALID_UNIX_TIMESTAMP_VALUE | 33 | --error ER_INVALID_TIME_VALUE |
568 | 34 | INSERT INTO t1 VALUES ("-10 1:22:33.45"); | 34 | INSERT INTO t1 VALUES ("-10 1:22:33.45"); |
569 | 35 | 35 | ||
570 | 36 | INSERT INTO t1 VALUES ("1999-02-03 20:33:34"); | 36 | INSERT INTO t1 VALUES ("1999-02-03 20:33:34"); |
571 | @@ -40,27 +40,29 @@ | |||
572 | 40 | insert t1 values ("1230"); | 40 | insert t1 values ("1230"); |
573 | 41 | insert t1 values ("12:30"); | 41 | insert t1 values ("12:30"); |
574 | 42 | insert t1 values ("12:30:35"); | 42 | insert t1 values ("12:30:35"); |
576 | 43 | --error ER_INVALID_UNIX_TIMESTAMP_VALUE | 43 | --error ER_INVALID_TIME_VALUE |
577 | 44 | insert t1 values ("1 12:30:31.32"); | 44 | insert t1 values ("1 12:30:31.32"); |
578 | 45 | 45 | ||
580 | 46 | select * from t1; | 46 | --sorted_result |
581 | 47 | select t from t1; | ||
582 | 47 | # Test wrong values | 48 | # Test wrong values |
584 | 48 | --error ER_INVALID_UNIX_TIMESTAMP_VALUE | 49 | --error ER_INVALID_TIME_VALUE |
585 | 49 | INSERT INTO t1 VALUES ("10.22.22"); | 50 | INSERT INTO t1 VALUES ("10.22.22"); |
586 | 50 | 51 | ||
587 | 51 | INSERT INTO t1 VALUES (1234567); | 52 | INSERT INTO t1 VALUES (1234567); |
588 | 52 | 53 | ||
589 | 53 | INSERT INTO t1 VALUES (123456789); | 54 | INSERT INTO t1 VALUES (123456789); |
590 | 54 | 55 | ||
592 | 55 | --error ER_INVALID_UNIX_TIMESTAMP_VALUE | 56 | --error ER_INVALID_TIME_VALUE |
593 | 56 | INSERT INTO t1 VALUES (123456789.10); | 57 | INSERT INTO t1 VALUES (123456789.10); |
594 | 57 | 58 | ||
596 | 58 | --error ER_INVALID_UNIX_TIMESTAMP_VALUE | 59 | --error ER_INVALID_TIME_VALUE |
597 | 59 | INSERT INTO t1 VALUES ("10 22:22"); | 60 | INSERT INTO t1 VALUES ("10 22:22"); |
598 | 60 | 61 | ||
600 | 61 | --error ER_INVALID_UNIX_TIMESTAMP_VALUE | 62 | --error ER_INVALID_TIME_VALUE |
601 | 62 | INSERT INTO t1 VALUES ("12.45a"); | 63 | INSERT INTO t1 VALUES ("12.45a"); |
603 | 63 | select * from t1; | 64 | --sorted_result |
604 | 65 | select t from t1; | ||
605 | 64 | DROP TABLE t1; | 66 | DROP TABLE t1; |
606 | 65 | 67 | ||
607 | 66 | CREATE TABLE t1 (t time); | 68 | CREATE TABLE t1 (t time); |
608 | @@ -119,7 +121,7 @@ | |||
609 | 119 | SELECT CAST('300:55:50' as time) > cast('240:00:00' as time); | 121 | SELECT CAST('300:55:50' as time) > cast('240:00:00' as time); |
610 | 120 | 122 | ||
611 | 121 | CREATE TABLE t1 (f1 time); | 123 | CREATE TABLE t1 (f1 time); |
613 | 122 | --error ER_INVALID_UNIX_TIMESTAMP_VALUE | 124 | --error ER_INVALID_TIME_VALUE |
614 | 123 | INSERT INTO t1 VALUES ('24:00:00'); | 125 | INSERT INTO t1 VALUES ('24:00:00'); |
615 | 124 | 126 | ||
616 | 125 | SELECT CAST('24:00:00' as time) = (select f1 from t1); | 127 | SELECT CAST('24:00:00' as time) = (select f1 from t1); |
617 | @@ -130,7 +132,7 @@ | |||
618 | 130 | # Bug#29739: Incorrect time comparison in BETWEEN. | 132 | # Bug#29739: Incorrect time comparison in BETWEEN. |
619 | 131 | # | 133 | # |
620 | 132 | CREATE TABLE t1(f1 time, f2 time); | 134 | CREATE TABLE t1(f1 time, f2 time); |
622 | 133 | --error ER_INVALID_UNIX_TIMESTAMP_VALUE | 135 | --error ER_INVALID_TIME_VALUE |
623 | 134 | INSERT INTO t1 VALUES('20:00:00','150:00:00'); | 136 | INSERT INTO t1 VALUES('20:00:00','150:00:00'); |
624 | 135 | 137 | ||
625 | 136 | select 1 from t1 where cast('100:00:00' as time) between f1 and f2; | 138 | select 1 from t1 where cast('100:00:00' as time) between f1 and f2; |
626 | 137 | 139 | ||
627 | === modified file 'tests/t/func_time.test' | |||
628 | --- tests/t/func_time.test 2011-01-20 06:31:31 +0000 | |||
629 | +++ tests/t/func_time.test 2011-01-27 20:14:35 +0000 | |||
630 | @@ -173,20 +173,28 @@ | |||
631 | 173 | 173 | ||
632 | 174 | create table t1 (d date, dt datetime, t timestamp, c char(10)); | 174 | create table t1 (d date, dt datetime, t timestamp, c char(10)); |
633 | 175 | insert into t1 values (null, null, null, null); | 175 | insert into t1 values (null, null, null, null); |
635 | 176 | --error ER_INVALID_DATETIME_VALUE # Bad dates... | 176 | |
636 | 177 | --error ER_INVALID_DATE_VALUE # Bad dates... | ||
637 | 177 | insert into t1 values ("0000-00-00", "0000-00-00", "0000-00-00", "0000-00-00"); | 178 | insert into t1 values ("0000-00-00", "0000-00-00", "0000-00-00", "0000-00-00"); |
638 | 179 | |||
639 | 178 | --error ER_INVALID_DATETIME_VALUE # 0000-00-00 is a bad date | 180 | --error ER_INVALID_DATETIME_VALUE # 0000-00-00 is a bad date |
640 | 179 | select dayofyear("0000-00-00"),dayofyear(d),dayofyear(dt),dayofyear(t),dayofyear(c) from t1; | 181 | select dayofyear("0000-00-00"),dayofyear(d),dayofyear(dt),dayofyear(t),dayofyear(c) from t1; |
641 | 182 | |||
642 | 180 | --error ER_INVALID_DATETIME_VALUE # 0000-00-00 is a bad date | 183 | --error ER_INVALID_DATETIME_VALUE # 0000-00-00 is a bad date |
643 | 181 | select dayofmonth("0000-00-00"),dayofmonth(d),dayofmonth(dt),dayofmonth(t),dayofmonth(c) from t1; | 184 | select dayofmonth("0000-00-00"),dayofmonth(d),dayofmonth(dt),dayofmonth(t),dayofmonth(c) from t1; |
644 | 185 | |||
645 | 182 | --error ER_INVALID_DATETIME_VALUE # 0000-00-00 is not a damn date. | 186 | --error ER_INVALID_DATETIME_VALUE # 0000-00-00 is not a damn date. |
646 | 183 | select month("0000-00-00"),month(d),month(dt),month(t),month(c) from t1; | 187 | select month("0000-00-00"),month(d),month(dt),month(t),month(c) from t1; |
647 | 188 | |||
648 | 184 | --error ER_INVALID_DATETIME_VALUE # 0000-00-00 not a date | 189 | --error ER_INVALID_DATETIME_VALUE # 0000-00-00 not a date |
649 | 185 | select quarter("0000-00-00"),quarter(d),quarter(dt),quarter(t),quarter(c) from t1; | 190 | select quarter("0000-00-00"),quarter(d),quarter(dt),quarter(t),quarter(c) from t1; |
650 | 191 | |||
651 | 186 | --error ER_INVALID_DATETIME_VALUE # Argh. 0000-00-00 is not a date. | 192 | --error ER_INVALID_DATETIME_VALUE # Argh. 0000-00-00 is not a date. |
652 | 187 | select year("0000-00-00"),year(d),year(dt),year(t),year(c) from t1; | 193 | select year("0000-00-00"),year(d),year(dt),year(t),year(c) from t1; |
653 | 194 | |||
654 | 188 | --error ER_INVALID_DATETIME_VALUE # Bad datetime | 195 | --error ER_INVALID_DATETIME_VALUE # Bad datetime |
655 | 189 | select to_days("0000-00-00"),to_days(d),to_days(dt),to_days(c) from t1; | 196 | select to_days("0000-00-00"),to_days(d),to_days(dt),to_days(c) from t1; |
656 | 197 | |||
657 | 190 | --error ER_INVALID_DATETIME_VALUE # Ugh. bad datetime | 198 | --error ER_INVALID_DATETIME_VALUE # Ugh. bad datetime |
658 | 191 | select extract(MONTH FROM "0000-00-00"),extract(MONTH FROM d),extract(MONTH FROM dt),extract(MONTH FROM t),extract(MONTH FROM c) from t1; | 199 | select extract(MONTH FROM "0000-00-00"),extract(MONTH FROM d),extract(MONTH FROM dt),extract(MONTH FROM t),extract(MONTH FROM c) from t1; |
659 | 192 | drop table t1; | 200 | drop table t1; |
660 | 193 | 201 | ||
661 | === modified file 'tests/t/select.test' | |||
662 | --- tests/t/select.test 2011-01-26 00:31:58 +0000 | |||
663 | +++ tests/t/select.test 2011-01-27 20:14:35 +0000 | |||
664 | @@ -2589,7 +2589,7 @@ | |||
665 | 2589 | insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'), | 2589 | insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'), |
666 | 2590 | (4,'2005-10-01'),(5,'2005-12-30'); | 2590 | (4,'2005-10-01'),(5,'2005-12-30'); |
667 | 2591 | # should return all records | 2591 | # should return all records |
669 | 2592 | --error ER_INVALID_DATETIME_VALUE # Bad date | 2592 | --error ER_INVALID_DATE_VALUE # Bad date |
670 | 2593 | select * from t1 where f2 >= 0 order by f2; | 2593 | select * from t1 where f2 >= 0 order by f2; |
671 | 2594 | --error ER_INVALID_DATETIME_VALUE # Bad date | 2594 | --error ER_INVALID_DATETIME_VALUE # Bad date |
672 | 2595 | select * from t1 where f2 >= '0000-00-00' order by f2; | 2595 | select * from t1 where f2 >= '0000-00-00' order by f2; |
673 | 2596 | 2596 | ||
674 | === modified file 'tests/t/type_date.test' | |||
675 | --- tests/t/type_date.test 2010-08-26 21:56:15 +0000 | |||
676 | +++ tests/t/type_date.test 2011-01-27 20:14:35 +0000 | |||
677 | @@ -117,10 +117,10 @@ | |||
678 | 117 | select @d:=011111; | 117 | select @d:=011111; |
679 | 118 | select year(@d), month(@d), day(@d), cast(@d as date); | 118 | select year(@d), month(@d), day(@d), cast(@d as date); |
680 | 119 | select @d:=1311; | 119 | select @d:=1311; |
682 | 120 | --error ER_INVALID_DATETIME_VALUE # Invalid datetime of 1311 | 120 | --error ER_INVALID_DATE_VALUE,ER_INVALID_DATETIME_VALUE # Invalid datetime of 1311 |
683 | 121 | select year(@d), month(@d), day(@d), cast(@d as date); | 121 | select year(@d), month(@d), day(@d), cast(@d as date); |
684 | 122 | create table t1 (d date , dt datetime , ts timestamp); | 122 | create table t1 (d date , dt datetime , ts timestamp); |
686 | 123 | -- error 1686 # Bad dates | 123 | --error ER_INVALID_DATE_VALUE # Bad dates |
687 | 124 | insert into t1 values (9912101,9912101,9912101); | 124 | insert into t1 values (9912101,9912101,9912101); |
688 | 125 | insert into t1 values (11111,11111,11111); | 125 | insert into t1 values (11111,11111,11111); |
689 | 126 | select * from t1; | 126 | select * from t1; |
690 | 127 | 127 | ||
691 | === modified file 'tests/t/type_datetime.test' | |||
692 | --- tests/t/type_datetime.test 2010-08-26 21:56:15 +0000 | |||
693 | +++ tests/t/type_datetime.test 2011-01-27 20:14:35 +0000 | |||
694 | @@ -190,7 +190,7 @@ | |||
695 | 190 | insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38'); | 190 | insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38'); |
696 | 191 | insert into t1 set dt='2007-03-23 13:49:38',da=dt; | 191 | insert into t1 set dt='2007-03-23 13:49:38',da=dt; |
697 | 192 | # Test error handling | 192 | # Test error handling |
699 | 193 | --error ER_INVALID_DATETIME_VALUE # Bad date | 193 | --error ER_INVALID_DATE_VALUE # Bad date |
700 | 194 | insert into t1 values ('2007-03-32','2007-03-23 13:49:38'); | 194 | insert into t1 values ('2007-03-32','2007-03-23 13:49:38'); |
701 | 195 | select * from t1; | 195 | select * from t1; |
702 | 196 | drop table t1; | 196 | drop table t1; |
703 | @@ -369,7 +369,7 @@ | |||
704 | 369 | insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38'); | 369 | insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38'); |
705 | 370 | insert into t1 set dt='2007-03-23 13:49:38',da=dt; | 370 | insert into t1 set dt='2007-03-23 13:49:38',da=dt; |
706 | 371 | # Test error handling | 371 | # Test error handling |
708 | 372 | --error ER_INVALID_DATETIME_VALUE # Bad date | 372 | --error ER_INVALID_DATE_VALUE # Bad date |
709 | 373 | insert into t1 values ('2007-03-32','2007-03-23 13:49:38'); | 373 | insert into t1 values ('2007-03-32','2007-03-23 13:49:38'); |
710 | 374 | select * from t1; | 374 | select * from t1; |
711 | 375 | drop table t1; | 375 | drop table t1; |