Merge lp:~brianaker/drizzle/timestamp into lp:drizzle/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
Reviewer Review Type Date Requested Status
Drizzle Developers Pending
Review via email: mp+47718@code.launchpad.net
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 ADD_ERROR_MESSAGE(ER_WRONG_PARAMETERS_TO_NATIVE_FCT, N_("Incorrect parameters in the call to native function '%-.192s'"));
6 ADD_ERROR_MESSAGE(ER_DUP_ENTRY_WITH_KEY_NAME, N_("Duplicate entry '%-.64s' for key '%-.192s'"));
7 ADD_ERROR_MESSAGE(ER_LOAD_DATA_INVALID_COLUMN, N_("Invalid column reference (%-.64s) in LOAD DATA"));
8- ADD_ERROR_MESSAGE(ER_INVALID_UNIX_TIMESTAMP_VALUE, N_("Received an invalid value '%s' for a UNIX timestamp."));
9+
10 ADD_ERROR_MESSAGE(ER_INVALID_DATETIME_VALUE, N_("Received an invalid datetime value '%s'."));
11+ ADD_ERROR_MESSAGE(ER_INVALID_DATE_VALUE, N_("Received an invalid DATE value '%s'."));
12+ ADD_ERROR_MESSAGE(ER_INVALID_NULL_ARGUMENT, N_("Received a NULL argument for function '%s'."));
13 ADD_ERROR_MESSAGE(ER_INVALID_TIMESTAMP_VALUE, N_("Received an invalid timestamp value '%s'."));
14- ADD_ERROR_MESSAGE(ER_INVALID_NULL_ARGUMENT, N_("Received a NULL argument for function '%s'."));
15+ ADD_ERROR_MESSAGE(ER_INVALID_TIME_VALUE, N_("Received an invalid TIME value '%s'."));
16+ ADD_ERROR_MESSAGE(ER_INVALID_UNIX_TIMESTAMP_VALUE, N_("Received an invalid value '%s' for a UNIX timestamp."));
17+
18 ADD_ERROR_MESSAGE(ER_ARGUMENT_OUT_OF_RANGE, N_("Received an out-of-range argument '%s' for function '%s'."));
19 ADD_ERROR_MESSAGE(ER_INVALID_ENUM_VALUE, N_("Received an invalid enum value '%s'."));
20 ADD_ERROR_MESSAGE(ER_NO_PRIMARY_KEY_ON_REPLICATED_TABLE, N_("Tables which are replicated require a primary key."));
21
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
27 ER_PARSE_ERROR_UNKNOWN,
28 ER_INVALID_CAST_TO_BOOLEAN,
29+ ER_INVALID_TIME_VALUE,
30+ ER_INVALID_DATE_VALUE,
31 ER_TRANSACTIONAL_DDL_NOT_SUPPORTED,
32+
33 // Leave ER_INVALID_BOOLEAN_VALUE as LAST, and force people to use tags
34 // instead of numbers in error messages in test.
35 ER_ERROR_LAST= ER_TRANSACTIONAL_DDL_NOT_SUPPORTED
36
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 DateTime temporal;
42 if (! temporal.from_string(from, (size_t) len))
43 {
44- my_error(ER_INVALID_DATETIME_VALUE, MYF(ME_FATALERROR), from);
45+ my_error(ER_INVALID_DATE_VALUE, MYF(ME_FATALERROR), from);
46 return 2;
47 }
48 /* Create the stored integer format. @TODO This should go away. Should be up to engine... */
49@@ -94,7 +94,7 @@
50 ss.precision(18); /* 18 places should be fine for error display of double input. */
51 ss << from; ss >> tmp;
52
53- my_error(ER_INVALID_DATETIME_VALUE, MYF(ME_FATALERROR), tmp.c_str());
54+ my_error(ER_INVALID_DATE_VALUE, MYF(ME_FATALERROR), tmp.c_str());
55 return 2;
56 }
57 return Field_date::store((int64_t) rint(from), false);
58@@ -113,13 +113,14 @@
59 /* Convert the integer to a string using boost::lexical_cast */
60 std::string tmp(boost::lexical_cast<std::string>(from));
61
62- my_error(ER_INVALID_DATETIME_VALUE, MYF(ME_FATALERROR), tmp.c_str());
63+ my_error(ER_INVALID_DATE_VALUE, MYF(ME_FATALERROR), tmp.c_str());
64 return 2;
65 }
66
67 /* Create the stored integer format. @TODO This should go away. Should be up to engine... */
68 uint32_t int_value= (temporal.years() * 10000) + (temporal.months() * 100) + temporal.days();
69 int4store(ptr, int_value);
70+
71 return 0;
72 }
73
74
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
80 if (not temporal.from_string(from, (size_t) len))
81 {
82- my_error(ER_INVALID_UNIX_TIMESTAMP_VALUE, MYF(ME_FATALERROR), from);
83+ std::string tmp(boost::lexical_cast<std::string>(from));
84+ my_error(ER_INVALID_TIME_VALUE, MYF(0), tmp.c_str());
85 return 1;
86 }
87
88@@ -94,44 +95,42 @@
89 int Time::store(double from)
90 {
91 ASSERT_COLUMN_MARKED_FOR_WRITE;
92- int64_t tmp;
93- int error= 0;
94-
95- if (from > (double)TIME_MAX_VALUE)
96- {
97- tmp= TIME_MAX_VALUE;
98- set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN,
99- ER_WARN_DATA_OUT_OF_RANGE, from, type::DRIZZLE_TIMESTAMP_TIME);
100- error= 1;
101- }
102- else if (from < (double) - TIME_MAX_VALUE)
103- {
104- tmp= -TIME_MAX_VALUE;
105- set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN,
106- ER_WARN_DATA_OUT_OF_RANGE, from, type::DRIZZLE_TIMESTAMP_TIME);
107- error= 1;
108- }
109- else
110- {
111- tmp=(long) floor(fabs(from)); // Remove fractions
112-
113- if (from < 0)
114- tmp= -tmp;
115-
116- if (tmp % 100 > 59 || tmp/100 % 100 > 59)
117- {
118- tmp=0;
119- set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN,
120- ER_WARN_DATA_OUT_OF_RANGE, from,
121- type::DRIZZLE_TIMESTAMP_TIME);
122- error= 1;
123- }
124- }
125-
126- if (not error)
127+
128+ do
129+ {
130+ int64_t tmp;
131+
132+ if (from > (double)TIME_MAX_VALUE)
133+ {
134+ tmp= TIME_MAX_VALUE;
135+ break;
136+ }
137+ else if (from < (double) - TIME_MAX_VALUE)
138+ {
139+ tmp= -TIME_MAX_VALUE;
140+ break;
141+ }
142+ else
143+ {
144+ tmp=(long) floor(fabs(from)); // Remove fractions
145+
146+ if (from < 0)
147+ tmp= -tmp;
148+
149+ if (tmp % 100 > 59 || tmp/100 % 100 > 59)
150+ {
151+ break;
152+ }
153+ }
154+
155 return store(tmp, false);
156
157- return error;
158+ } while (0);
159+
160+ std::string tmp(boost::lexical_cast<std::string>(from));
161+ my_error(ER_INVALID_TIME_VALUE, MYF(0), tmp.c_str());
162+
163+ return 1;
164 }
165
166 int Time::store(int64_t from, bool)
167@@ -143,12 +142,11 @@
168 * if unable to create a valid DateTime.
169 */
170 drizzled::Time temporal;
171- if (! temporal.from_time_t(from))
172+ if (not temporal.from_time_t(from))
173 {
174 /* Convert the integer to a string using boost::lexical_cast */
175 std::string tmp(boost::lexical_cast<std::string>(from));
176-
177- my_error(ER_INVALID_UNIX_TIMESTAMP_VALUE, MYF(ME_FATALERROR), tmp.c_str());
178+ my_error(ER_INVALID_TIME_VALUE, MYF(0), tmp.c_str());
179 return 2;
180 }
181
182
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 public:
188 using Item_func::tmp_table_field;
189
190- Item_date_typecast(Item *a) :Item_typecast_maybe_null(a) {}
191+ Item_date_typecast(Item *a) :
192+ Item_typecast_maybe_null(a)
193+ {}
194+
195 const char *func_name() const { return "cast_as_date"; }
196 String *val_str(String *str);
197 bool get_date(type::Time &ltime, uint32_t fuzzy_date);
198 bool get_time(type::Time &ltime);
199 const char *cast_type() const { return "date"; }
200 enum_field_types field_type() const { return DRIZZLE_TYPE_DATE; }
201+
202 Field *tmp_table_field(Table *table)
203 {
204 return tmp_table_field_from_field_type(table, 0);
205 }
206+
207 void fix_length_and_dec()
208 {
209 collation.set(&my_charset_bin);
210 max_length= 10;
211 maybe_null= 1;
212 }
213+
214 bool result_as_int64_t() { return true; }
215 int64_t val_int();
216 double val_real() { return (double) val_int(); }
217+
218 type::Decimal *val_decimal(type::Decimal *decimal_value)
219 {
220 assert(fixed == 1);
221 return val_decimal_from_date(decimal_value);
222 }
223- int save_in_field(Field *field,
224- bool )
225+
226+ int save_in_field(Field *field, bool )
227 {
228 return save_date_in_field(field);
229 }
230
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 datatime_t while being stored in an integer is actually a formatted value.
236 */
237 typedef int64_t datetime_t;
238+typedef int64_t date_t;
239
240 inline bool is_valid(const datetime_t &value)
241 {
242
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
248 Testing MIN-1 DATE
249 INSERT INTO t1 (b) VALUES('0000-12-31');
250-ERROR HY000: Received an invalid datetime value '0000-12-31'.
251+ERROR HY000: Received an invalid DATE value '0000-12-31'.
252 Check transaction_log_entries
253 SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES;
254 COUNT(*)
255@@ -2411,7 +2411,7 @@
256
257 Testing MAX+1 DATE
258 INSERT INTO t1 (b) VALUES('10000-01-01');
259-ERROR HY000: Received an invalid datetime value '10000-01-01'.
260+ERROR HY000: Received an invalid DATE value '10000-01-01'.
261 Check transaction_log_entries
262 SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES;
263 COUNT(*)
264@@ -2628,7 +2628,7 @@
265
266 Testing BAD INPUT DATE1
267 INSERT INTO t1 (b) VALUES('abbazabba');
268-ERROR HY000: Received an invalid datetime value 'abbazabba'.
269+ERROR HY000: Received an invalid DATE value 'abbazabba'.
270 Check transaction_log_entries
271 SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES;
272 COUNT(*)
273@@ -2683,7 +2683,7 @@
274
275 Testing BAD INPUT DATE2
276 INSERT INTO t1 (b) VALUES('a');
277-ERROR HY000: Received an invalid datetime value 'a'.
278+ERROR HY000: Received an invalid DATE value 'a'.
279 Check transaction_log_entries
280 SELECT COUNT(*) FROM DATA_DICTIONARY.TRANSACTION_LOG_ENTRIES;
281 COUNT(*)
282
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 --echo
288
289 --echo Testing MIN-1 DATE
290---ERROR 1686
291+--ERROR ER_INVALID_DATE_VALUE
292 INSERT INTO t1 (b) VALUES('0000-12-31');
293 --source ../plugin/transaction_log/tests/t/check_transaction_log.inc
294 --echo
295
296 --echo Testing MAX+1 DATE
297---ERROR 1686
298+--ERROR ER_INVALID_DATE_VALUE
299 INSERT INTO t1 (b) VALUES('10000-01-01');
300 --source ../plugin/transaction_log/tests/t/check_transaction_log.inc
301 --echo
302@@ -367,13 +367,13 @@
303 --echo
304
305 --echo Testing BAD INPUT DATE1
306---ERROR 1686
307+--ERROR ER_INVALID_DATE_VALUE
308 INSERT INTO t1 (b) VALUES('abbazabba');
309 --source ../plugin/transaction_log/tests/t/check_transaction_log.inc
310 --echo
311
312 --echo Testing BAD INPUT DATE2
313---ERROR 1686
314+--ERROR ER_INVALID_DATE_VALUE
315 INSERT INTO t1 (b) VALUES('a');
316 --source ../plugin/transaction_log/tests/t/check_transaction_log.inc
317 --echo
318@@ -402,13 +402,13 @@
319 --echo
320
321 --echo Testing MIN-1 DATETIME
322---ERROR 1686
323+--ERROR ER_INVALID_DATETIME_VALUE
324 INSERT INTO t1 (b) VALUES('0000-01-01');
325 --source ../plugin/transaction_log/tests/t/check_transaction_log.inc
326 --echo
327
328 --echo Testing MAX+1 DATETIME
329---ERROR 1686
330+--ERROR ER_INVALID_DATETIME_VALUE
331 INSERT INTO t1 (b) VALUES('10000-01-01');
332 --source ../plugin/transaction_log/tests/t/check_transaction_log.inc
333 --echo
334@@ -429,19 +429,19 @@
335 --echo
336
337 --echo Testing BAD INPUT DATETIME1
338---ERROR 1686
339+--ERROR ER_INVALID_DATETIME_VALUE
340 INSERT INTO t1 (b) VALUES('2000-01-01 25:00:00');
341 --source ../plugin/transaction_log/tests/t/check_transaction_log.inc
342 --echo
343
344 --echo Testing BAD INPUT DATETIME2
345---ERROR 1686
346+--ERROR ER_INVALID_DATETIME_VALUE
347 INSERT INTO t1 (b) VALUES('2000-01-01 12:60:00');
348 --source ../plugin/transaction_log/tests/t/check_transaction_log.inc
349 --echo
350
351 --echo Testing BAD INPUT DATETIME3
352---ERROR 1686
353+--ERROR ER_INVALID_DATETIME_VALUE
354 INSERT INTO t1 (b) VALUES('2000-01-01 12:00:70');
355 --source ../plugin/transaction_log/tests/t/check_transaction_log.inc
356 --echo
357
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 create table t1 (d date, dt datetime, t timestamp, c char(10));
363 insert into t1 values (null, null, null, null);
364 insert into t1 values ("0000-00-00", "0000-00-00", "0000-00-00", "0000-00-00");
365-ERROR HY000: Received an invalid datetime value '0000-00-00'.
366+ERROR HY000: Received an invalid DATE value '0000-00-00'.
367 select dayofyear("0000-00-00"),dayofyear(d),dayofyear(dt),dayofyear(t),dayofyear(c) from t1;
368 ERROR HY000: Received an invalid datetime value '0000-00-00'.
369 select dayofmonth("0000-00-00"),dayofmonth(d),dayofmonth(dt),dayofmonth(t),dayofmonth(c) from t1;
370
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 insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'),
376 (4,'2005-10-01'),(5,'2005-12-30');
377 select * from t1 where f2 >= 0 order by f2;
378-ERROR HY000: Received an invalid datetime value '0'.
379+ERROR HY000: Received an invalid DATE value '0'.
380 select * from t1 where f2 >= '0000-00-00' order by f2;
381 ERROR HY000: Received an invalid datetime value '0000-00-00'.
382 select * from t1 where f2 >= '2005-09-31' order by f2;
383
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 @d:=1311
389 1311
390 select year(@d), month(@d), day(@d), cast(@d as date);
391-ERROR HY000: Received an invalid datetime value '1311'.
392+Got one of the listed errors
393 create table t1 (d date , dt datetime , ts timestamp);
394 insert into t1 values (9912101,9912101,9912101);
395-ERROR HY000: Received an invalid datetime value '9912101'.
396+ERROR HY000: Received an invalid DATE value '9912101'.
397 insert into t1 values (11111,11111,11111);
398 select * from t1;
399 d dt ts
400
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 insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
406 insert into t1 set dt='2007-03-23 13:49:38',da=dt;
407 insert into t1 values ('2007-03-32','2007-03-23 13:49:38');
408-ERROR HY000: Received an invalid datetime value '2007-03-32'.
409+ERROR HY000: Received an invalid DATE value '2007-03-32'.
410 select * from t1;
411 da dt
412 1962-03-03 1962-03-03 00:00:00
413@@ -457,7 +457,7 @@
414 insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
415 insert into t1 set dt='2007-03-23 13:49:38',da=dt;
416 insert into t1 values ('2007-03-32','2007-03-23 13:49:38');
417-ERROR HY000: Received an invalid datetime value '2007-03-32'.
418+ERROR HY000: Received an invalid DATE value '2007-03-32'.
419 select * from t1;
420 da dt
421 1962-03-03 1962-03-03 00:00:00
422
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 INSERT INTO t1 VALUES (1234);
428 INSERT INTO t1 VALUES (123456.78);
429 INSERT INTO t1 VALUES (1234559.99);
430-ERROR HY000: Received an invalid value '1234559.99' for a UNIX timestamp.
431+ERROR HY000: Received an invalid TIME value '1234559.99'.
432 INSERT INTO t1 VALUES ("1");
433 INSERT INTO t1 VALUES ("1:23");
434 INSERT INTO t1 VALUES ("1:23:45");
435 INSERT INTO t1 VALUES ("10.22");
436 INSERT INTO t1 VALUES ("20 10:22:33");
437-ERROR HY000: Received an invalid value '20 10:22:33' for a UNIX timestamp.
438+ERROR HY000: Received an invalid TIME value '20 10:22:33'.
439 INSERT INTO t1 VALUES ("-10 1:22:33.45");
440-ERROR HY000: Received an invalid value '-10 1:22:33.45' for a UNIX timestamp.
441+ERROR HY000: Received an invalid TIME value '-10 1:22:33.45'.
442 INSERT INTO t1 VALUES ("1999-02-03 20:33:34");
443 insert t1 values (30);
444 insert t1 values (1230);
445@@ -22,52 +22,52 @@
446 insert t1 values ("12:30");
447 insert t1 values ("12:30:35");
448 insert t1 values ("1 12:30:31.32");
449-ERROR HY000: Received an invalid value '1 12:30:31.32' for a UNIX timestamp.
450-select * from t1;
451+ERROR HY000: Received an invalid TIME value '1 12:30:31.32'.
452+select t from t1;
453 t
454-10:22:33
455-12:34:56
456-00:00:10
457-00:20:34
458-12:34:56
459 00:00:01
460+00:00:10
461+00:00:10
462+00:00:30
463 00:01:23
464+00:12:30
465+00:12:30
466+00:20:30
467+00:20:34
468 01:23:45
469-00:00:10
470+10:22:33
471+12:30:35
472+12:34:56
473+12:34:56
474 20:33:34
475-00:00:30
476-00:20:30
477-00:12:30
478-00:12:30
479-12:30:35
480 INSERT INTO t1 VALUES ("10.22.22");
481-ERROR HY000: Received an invalid value '10.22.22' for a UNIX timestamp.
482+ERROR HY000: Received an invalid TIME value '10.22.22'.
483 INSERT INTO t1 VALUES (1234567);
484 INSERT INTO t1 VALUES (123456789);
485 INSERT INTO t1 VALUES (123456789.10);
486-ERROR HY000: Received an invalid value '123456789.10' for a UNIX timestamp.
487+ERROR HY000: Received an invalid TIME value '123456789.10'.
488 INSERT INTO t1 VALUES ("10 22:22");
489-ERROR HY000: Received an invalid value '10 22:22' for a UNIX timestamp.
490+ERROR HY000: Received an invalid TIME value '10 22:22'.
491 INSERT INTO t1 VALUES ("12.45a");
492-ERROR HY000: Received an invalid value '12.45a' for a UNIX timestamp.
493-select * from t1;
494+ERROR HY000: Received an invalid TIME value '12.45a'.
495+select t from t1;
496 t
497-10:22:33
498-12:34:56
499-00:00:10
500-00:20:34
501-12:34:56
502 00:00:01
503+00:00:10
504+00:00:10
505+00:00:30
506 00:01:23
507+00:12:30
508+00:12:30
509+00:20:30
510+00:20:34
511 01:23:45
512-00:00:10
513-20:33:34
514-00:00:30
515-00:20:30
516-00:12:30
517-00:12:30
518-12:30:35
519 06:56:07
520+10:22:33
521+12:30:35
522+12:34:56
523+12:34:56
524+20:33:34
525 21:33:09
526 DROP TABLE t1;
527 CREATE TABLE t1 (t time);
528@@ -106,14 +106,14 @@
529 1
530 CREATE TABLE t1 (f1 time);
531 INSERT INTO t1 VALUES ('24:00:00');
532-ERROR HY000: Received an invalid value '24:00:00' for a UNIX timestamp.
533+ERROR HY000: Received an invalid TIME value '24:00:00'.
534 SELECT CAST('24:00:00' as time) = (select f1 from t1);
535 CAST('24:00:00' as time) = (select f1 from t1)
536 NULL
537 DROP TABLE t1;
538 CREATE TABLE t1(f1 time, f2 time);
539 INSERT INTO t1 VALUES('20:00:00','150:00:00');
540-ERROR HY000: Received an invalid value '150:00:00' for a UNIX timestamp.
541+ERROR HY000: Received an invalid TIME value '150:00:00'.
542 select 1 from t1 where cast('100:00:00' as time) between f1 and f2;
543 1
544 DROP TABLE t1;
545
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
551 INSERT INTO t1 VALUES (123456.78);
552
553---error ER_INVALID_UNIX_TIMESTAMP_VALUE
554+--error ER_INVALID_TIME_VALUE
555 INSERT INTO t1 VALUES (1234559.99);
556
557 INSERT INTO t1 VALUES ("1");
558@@ -27,10 +27,10 @@
559
560 INSERT INTO t1 VALUES ("10.22");
561
562---error ER_INVALID_UNIX_TIMESTAMP_VALUE
563+--error ER_INVALID_TIME_VALUE
564 INSERT INTO t1 VALUES ("20 10:22:33");
565
566---error ER_INVALID_UNIX_TIMESTAMP_VALUE
567+--error ER_INVALID_TIME_VALUE
568 INSERT INTO t1 VALUES ("-10 1:22:33.45");
569
570 INSERT INTO t1 VALUES ("1999-02-03 20:33:34");
571@@ -40,27 +40,29 @@
572 insert t1 values ("1230");
573 insert t1 values ("12:30");
574 insert t1 values ("12:30:35");
575---error ER_INVALID_UNIX_TIMESTAMP_VALUE
576+--error ER_INVALID_TIME_VALUE
577 insert t1 values ("1 12:30:31.32");
578
579-select * from t1;
580+--sorted_result
581+select t from t1;
582 # Test wrong values
583---error ER_INVALID_UNIX_TIMESTAMP_VALUE
584+--error ER_INVALID_TIME_VALUE
585 INSERT INTO t1 VALUES ("10.22.22");
586
587 INSERT INTO t1 VALUES (1234567);
588
589 INSERT INTO t1 VALUES (123456789);
590
591---error ER_INVALID_UNIX_TIMESTAMP_VALUE
592+--error ER_INVALID_TIME_VALUE
593 INSERT INTO t1 VALUES (123456789.10);
594
595---error ER_INVALID_UNIX_TIMESTAMP_VALUE
596+--error ER_INVALID_TIME_VALUE
597 INSERT INTO t1 VALUES ("10 22:22");
598
599---error ER_INVALID_UNIX_TIMESTAMP_VALUE
600+--error ER_INVALID_TIME_VALUE
601 INSERT INTO t1 VALUES ("12.45a");
602-select * from t1;
603+--sorted_result
604+select t from t1;
605 DROP TABLE t1;
606
607 CREATE TABLE t1 (t time);
608@@ -119,7 +121,7 @@
609 SELECT CAST('300:55:50' as time) > cast('240:00:00' as time);
610
611 CREATE TABLE t1 (f1 time);
612---error ER_INVALID_UNIX_TIMESTAMP_VALUE
613+--error ER_INVALID_TIME_VALUE
614 INSERT INTO t1 VALUES ('24:00:00');
615
616 SELECT CAST('24:00:00' as time) = (select f1 from t1);
617@@ -130,7 +132,7 @@
618 # Bug#29739: Incorrect time comparison in BETWEEN.
619 #
620 CREATE TABLE t1(f1 time, f2 time);
621---error ER_INVALID_UNIX_TIMESTAMP_VALUE
622+--error ER_INVALID_TIME_VALUE
623 INSERT INTO t1 VALUES('20:00:00','150:00:00');
624
625 select 1 from t1 where cast('100:00:00' as time) between f1 and f2;
626
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
632 create table t1 (d date, dt datetime, t timestamp, c char(10));
633 insert into t1 values (null, null, null, null);
634---error ER_INVALID_DATETIME_VALUE # Bad dates...
635+
636+--error ER_INVALID_DATE_VALUE # Bad dates...
637 insert into t1 values ("0000-00-00", "0000-00-00", "0000-00-00", "0000-00-00");
638+
639 --error ER_INVALID_DATETIME_VALUE # 0000-00-00 is a bad date
640 select dayofyear("0000-00-00"),dayofyear(d),dayofyear(dt),dayofyear(t),dayofyear(c) from t1;
641+
642 --error ER_INVALID_DATETIME_VALUE # 0000-00-00 is a bad date
643 select dayofmonth("0000-00-00"),dayofmonth(d),dayofmonth(dt),dayofmonth(t),dayofmonth(c) from t1;
644+
645 --error ER_INVALID_DATETIME_VALUE # 0000-00-00 is not a damn date.
646 select month("0000-00-00"),month(d),month(dt),month(t),month(c) from t1;
647+
648 --error ER_INVALID_DATETIME_VALUE # 0000-00-00 not a date
649 select quarter("0000-00-00"),quarter(d),quarter(dt),quarter(t),quarter(c) from t1;
650+
651 --error ER_INVALID_DATETIME_VALUE # Argh. 0000-00-00 is not a date.
652 select year("0000-00-00"),year(d),year(dt),year(t),year(c) from t1;
653+
654 --error ER_INVALID_DATETIME_VALUE # Bad datetime
655 select to_days("0000-00-00"),to_days(d),to_days(dt),to_days(c) from t1;
656+
657 --error ER_INVALID_DATETIME_VALUE # Ugh. bad datetime
658 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 drop table t1;
660
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 insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'),
666 (4,'2005-10-01'),(5,'2005-12-30');
667 # should return all records
668---error ER_INVALID_DATETIME_VALUE # Bad date
669+--error ER_INVALID_DATE_VALUE # Bad date
670 select * from t1 where f2 >= 0 order by f2;
671 --error ER_INVALID_DATETIME_VALUE # Bad date
672 select * from t1 where f2 >= '0000-00-00' order by f2;
673
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 select @d:=011111;
679 select year(@d), month(@d), day(@d), cast(@d as date);
680 select @d:=1311;
681---error ER_INVALID_DATETIME_VALUE # Invalid datetime of 1311
682+--error ER_INVALID_DATE_VALUE,ER_INVALID_DATETIME_VALUE # Invalid datetime of 1311
683 select year(@d), month(@d), day(@d), cast(@d as date);
684 create table t1 (d date , dt datetime , ts timestamp);
685--- error 1686 # Bad dates
686+--error ER_INVALID_DATE_VALUE # Bad dates
687 insert into t1 values (9912101,9912101,9912101);
688 insert into t1 values (11111,11111,11111);
689 select * from t1;
690
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 insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
696 insert into t1 set dt='2007-03-23 13:49:38',da=dt;
697 # Test error handling
698---error ER_INVALID_DATETIME_VALUE # Bad date
699+--error ER_INVALID_DATE_VALUE # Bad date
700 insert into t1 values ('2007-03-32','2007-03-23 13:49:38');
701 select * from t1;
702 drop table t1;
703@@ -369,7 +369,7 @@
704 insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
705 insert into t1 set dt='2007-03-23 13:49:38',da=dt;
706 # Test error handling
707---error ER_INVALID_DATETIME_VALUE # Bad date
708+--error ER_INVALID_DATE_VALUE # Bad date
709 insert into t1 values ('2007-03-32','2007-03-23 13:49:38');
710 select * from t1;
711 drop table t1;

Subscribers

People subscribed via source and target branches