Commit 79b2bd53 authored by msvensson@pilot.blaudden's avatar msvensson@pilot.blaudden

Merge pilot.blaudden:/home/msvensson/mysql/bug25482/my41-bug25482-alt2

into  pilot.blaudden:/home/msvensson/mysql/mysql-4.1-maint
parents a71d1951 110c2961
......@@ -219,7 +219,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
key_parts+=fulltext_keys*FT_SEGS;
if (share->base.max_key_length > MI_MAX_KEY_BUFF || keys > MI_MAX_KEY ||
key_parts >= MI_MAX_KEY * MI_MAX_KEY_SEG)
key_parts > MI_MAX_KEY * MI_MAX_KEY_SEG)
{
DBUG_PRINT("error",("Wrong key info: Max_key_length: %d keys: %d key_parts: %d", share->base.max_key_length, keys, key_parts));
my_errno=HA_ERR_UNSUPPORTED;
......
This diff is collapsed.
......@@ -181,12 +181,12 @@ date format datetime
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.123450
2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 00:11:12.123450
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 2003-01-02 23:11:12
10:20:10 %H:%i:%s 0000-00-00 00:00:00
10:20:10 %h:%i:%s.%f 0000-00-00 00:00:00
10:20:10 %T 0000-00-00 00:00:00
10:20:10AM %h:%i:%s%p 0000-00-00 00:00:00
10:20:10AM %r 0000-00-00 00:00:00
10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 00:00:00
10:20:10 %H:%i:%s 0000-00-00 10:20:10
10:20:10 %h:%i:%s.%f 0000-00-00 10:20:10
10:20:10 %T 0000-00-00 10:20:10
10:20:10AM %h:%i:%s%p 0000-00-00 10:20:10
10:20:10AM %r 0000-00-00 10:20:10
10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.440000
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58
15 September 2001 %d %M %Y 2001-09-15 00:00:00
15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00
......@@ -203,13 +203,6 @@ Tuesday 52 2001 %W %V %X 2002-01-01 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 2001-01-15 00:00:00
15-01-20 %d-%m-%y 2020-01-15 00:00:00
15-2001-1 %d-%Y-%c 2001-01-15 00:00:00
Warnings:
Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10.440000'
select date,format,DATE(str_to_date(date, format)) as date2 from t1;
date format date2
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02
......@@ -250,12 +243,12 @@ date format time
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450
2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12
10:20:10 %H:%i:%s NULL
10:20:10 %h:%i:%s.%f NULL
10:20:10 %T NULL
10:20:10AM %h:%i:%s%p NULL
10:20:10AM %r NULL
10:20:10.44AM %h:%i:%s.%f%p NULL
10:20:10 %H:%i:%s 10:20:10
10:20:10 %h:%i:%s.%f 10:20:10
10:20:10 %T 10:20:10
10:20:10AM %h:%i:%s%p 10:20:10
10:20:10AM %r 10:20:10
10:20:10.44AM %h:%i:%s.%f%p 10:20:10.440000
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58
15 September 2001 %d %M %Y 00:00:00
15 SEPTEMB 2001 %d %M %Y 00:00:00
......@@ -272,13 +265,6 @@ Tuesday 52 2001 %W %V %X 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00
15-01-20 %d-%m-%y 00:00:00
15-2001-1 %d-%Y-%c 00:00:00
Warnings:
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10.440000'
select date,format,concat(TIME(str_to_date(date, format))) as time2 from t1;
date format time2
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 10:11:12
......@@ -288,12 +274,12 @@ date format time2
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450
2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12
10:20:10 %H:%i:%s NULL
10:20:10 %h:%i:%s.%f NULL
10:20:10 %T NULL
10:20:10AM %h:%i:%s%p NULL
10:20:10AM %r NULL
10:20:10.44AM %h:%i:%s.%f%p NULL
10:20:10 %H:%i:%s 10:20:10
10:20:10 %h:%i:%s.%f 10:20:10
10:20:10 %T 10:20:10
10:20:10AM %h:%i:%s%p 10:20:10
10:20:10AM %r 10:20:10
10:20:10.44AM %h:%i:%s.%f%p 10:20:10.440000
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58
15 September 2001 %d %M %Y 00:00:00
15 SEPTEMB 2001 %d %M %Y 00:00:00
......@@ -310,13 +296,6 @@ Tuesday 52 2001 %W %V %X 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00
15-01-20 %d-%m-%y 00:00:00
15-2001-1 %d-%Y-%c 00:00:00
Warnings:
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10.440000'
select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d'));
concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d'))
2003-01-02 08:11:02.123456
......
This diff is collapsed.
......@@ -350,10 +350,7 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
l_time->year > 9999 || l_time->month > 12 ||
l_time->day > 31 || l_time->hour > 23 ||
l_time->minute > 59 || l_time->second > 59 ||
(!(flags & TIME_FUZZY_DATE) &&
(l_time->month == 0 || l_time->day == 0)) ||
(l_time->year == 0 && l_time->month == 0 && l_time->day == 0 &&
(l_time->hour != 0 || l_time->minute != 0 || l_time->second != 0)))
(!(flags & TIME_FUZZY_DATE) && (l_time->month == 0 || l_time->day == 0)))
{
/* Only give warning for a zero date if there is some garbage after */
if (!not_zero_date) /* If zero date */
......
......@@ -1283,7 +1283,18 @@ File create_frm(register my_string name, const char *db, const char *table,
fileinfo[3]= (uchar) ha_checktype(create_info->db_type);
fileinfo[4]=1;
int2store(fileinfo+6,IO_SIZE); /* Next block starts here */
key_length=keys*(7+NAME_LEN+MAX_REF_PARTS*9)+16;
/*
For each key (see unireg.cc::pack_keys()):
8 bytes for the key header
9 bytes for each key-part (MAX_REF_PARTS)
NAME_LEN bytes for the name
1 byte for the NAMES_SEP_CHAR (before the name)
For all keys:
6 bytes for the header
1 byte for the NAMES_SEP_CHAR (after the last name)
9 extra bytes (padding for safety? alignment?)
*/
key_length= keys * (8 + MAX_REF_PARTS * 9 + NAME_LEN + 1) + 16;
length=(ulong) next_io_size((ulong) (IO_SIZE+key_length+reclength));
int4store(fileinfo+10,length);
if (key_length > 0xffff) key_length=0xffff;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment